Fractions

A fraction expressed in decimal can be the ratio of an infinite number of pairs of integers. Suppose a fraction is rounded to three digits after the decimal point and its rounded value is 0.500. Then the original fraction can be 1, 500 or even 600 , 28932, etc. You will be given the value of the decimal 2 1000 1201 57869 fraction rounded to some digits (not more than 7 digits) and you will have to find out the total number of different fractions that can actually be rounded to this value. For safety you can assume that 0.2355 when rounded to three digits after the decimal point is always rounded as 0.236 and never as 0.235. You can also assume that the value of numerator or denominator will never exceed 1000000000. Input The input file can contain up to 100000 lines of inputs. Each line contains a positive floating-point number v (0 < v < 1). This number will have minimum one digit and maximum seven digits after the decimal point . If this number has n digits after the decimal point then you have to assume that the value of the fraction is given rounded to n digits after the decimal point. Input is terminated by a line containing ‘#’. Output For each line of input produce one line of output. This line contains an integer T which denotes how many different fractions are there (With numerators and denominator being positive and not exceeding 1000000000) that will have value v when rounded to n digits after the decimal point. Sample Input 0.0000001 0.5000000

Sample Output 50000000050 50000000050