 Frankfurt UAS, KMITL, VGU & SPbGUT - Combinatorics & Number Theory

#### Start

2017-03-26 21:00 AKDT

## Frankfurt UAS, KMITL, VGU & SPbGUT - Combinatorics & Number Theory

#### End

2017-03-30 10:00 AKDT
The end is near!
Contest is over.
Not yet started.
Contest is starting in -1667 days 3:00:24

85:00:00

0:00:00

# Problem QInverse Factorial Photo by Ginette

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 \cdot 2 \cdot 3 \cdot \ldots \cdot 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$.

## Input

The input contains the factorial $n!$ of a positive integer $n$. The number of digits of $n!$ is at most $10^{6}$.

## Output

Output the value of $n$.

Sample Input 1 Sample Output 1
120

5

Sample Input 2 Sample Output 2
51090942171709440000

21

Sample Input 3 Sample Output 3
10888869450418352160768000000

27