Rikka with Composite Number

아직 제출이 없습니다시간 제한1초메모리 제한512 MB

문제

Rikka is a professional problem setter. Today, she is going to generate test cases for a problem about Composite Number.

To randomly generate composite numbers, Rikka starts from a non-empty subset DD of digits 1,2,,9\\{1,2,\dots, 9\\} and integer c=0c = 0, and then generates in turns. In each turn:

  1. Rikka selects a digit dd from DD uniformly at random, and then changes cc to c×10+dc \times 10 + d;
  2. If cc has already been a composite integer, Rikka takes cc as the result. Otherwise, Rikka returns to Step 11 and starts a new turn.

The time cost of a generator is crucial. Therefore, Rikka wants you to calculate the expected number of the turns used by the generator to generate a composite number.

A positive integer nn is a composite integer if and only if there exists an integer k\[2,n1]k \in \[2, n - 1] satisfying kk is a factor of nn.

입력

The first line contains a 0101-string of length 99. The ii-th character is 11 if and only if digit ii is inside DD.

The input guarantees that DD is not empty.

출력

Output a single integer, representing the expected number of turns.

The answer is guaranteed to be a rational number. You are required to output the answer module 998244353998244353. Formally, if the simplest fraction representation of the answer is xy\frac{x}{y}, you need to output x×y998244351 mod 998244353x \times y^{998244351} \text{ mod } 998244353.

힌트

For the first sample, the generator must return 111111 in the third turn.

For the second sample, there are 33 possibilities:

  • Return 44 in the first turn, with probability 12\frac{1}{2};
  • Return 3333 in the second turn, with probability 14\frac{1}{4};
  • Return 3434 in the second turn, with probability 14\frac{1}{4}.

Therefore, the expected number of turns is 32\frac{3}{2}.