#B3710. Gacha Simulator Setting Count

    ID: 11369 Type: Default 1000ms 256MiB

Gacha Simulator Setting Count

Gacha Simulator Setting Count

E has designed a gacha (card drawing) simulator. In this simulator, you have 5 draws; however, if the best card (called CARD) is not obtained in the first 4 draws, the 5th one is guaranteed to be CARD. For the first 4 draws, you are allowed to set the probability of drawing CARD to p1, p2, p3, p4 respectively. Each pi must be in the range [0, 1] and given with exactly two decimal places (for example, 0.12).

Since the 5th draw is a guarantee, the probability that the CARD is not drawn in the first 4 draws is

[ S = (1-p_{1})\cdot (1-p_{2})\cdot (1-p_{3})\cdot (1-p_{4}). ]

You are given the value of S (with exactly two decimal places) and are asked to determine the number of possible settings (i.e. quadruples \( (p_{1},p_{2},p_{3},p_{4}) \)) satisfying the equation above.

Note: In order to avoid precision issues, each probability is considered only in hundredths. In other words, if we let \( q_{i} = 100 \times p_{i} \) then \( q_{i}\in\{0,1,2,\ldots,100\} \) and the equation becomes:

[ (100-q_{1})\cdot(100-q_{2})\cdot(100-q_{3})\cdot(100-q_{4}) = S \times 100^4. ]

inputFormat

The input consists of a single line containing a decimal number S with exactly two decimal places.

outputFormat

Output a single integer representing the number of quadruple settings \((p_{1}, p_{2}, p_{3}, p_{4})\) that satisfy the equation.

sample

1.00
1