<PREV Problem:
NEXT>
Solved by 927 users: ...
 < 
 < 
 < 
 < 
 < 
 < 
 < 
 < 
 < 
 < 

Anti-factorial

Time limit = 1 second

For any given natural number n the product 1*2*...*n is called n factorial and it is denoted by n!. Given the value of n! for some integer n>=1, your task is to find n.

Input. The single line of the input data contains the value of n!. The number of decimal digits in n! does not exceed 255. Also, the given number does not contain leading zeroes.

Output. Output the single line containing the requested number n.

Input#1
1
Output#1
1

Input#2
120
Output#2
5

Author:
ACM ICPC 2005-2006, NEERC, Moscow Subregional Contest
October 23, 2005

<PREV | Problem set | Search related messages | NEXT>


© acm.mipt DevGroup
The page was generated in 210ms

SW soft NIX
ID = 54.81.197.127