시간 제한 메모리 제한 제출 정답 맞은 사람 정답 비율
2 초 512 MB 15 6 5 38.462%

문제

A factorial n! of a positive integer n is defined as the product of all positive integers smaller than or equal to n. For example,

21! = 1 × 2 × 3 × · · · × 21 = 51 090 942 171 709 440 000.

It is straightforward to calculate the factorial of a small integer, and you have probably done it many times before. In this problem, however, your task is reversed. You are given the value of n! and you have to find the value of n.

입력

The input contains the factorial n! of a positive integer n. The number of digits of n! is at most 106.

출력

Output the value of n.

예제 입력

120

예제 출력

5

예제 입력 2

51090942171709440000

예제 출력 2

21

예제 입력 3

10888869450418352160768000000

예제 출력 3

27

힌트