cho.sh
Notes
Loading...

Factorial 5

Time limit

2s

Memory limit

128 MB

Problem

The factorial 5 of N is the last five digits that remain after removing all trailing zeros from N!.

If fewer than five digits remain, pad the answer on the left with zeros so that exactly five digits are printed.

Given N, compute its factorial 5.

Input

The first line contains an integer N.

9 <= N <= 1,000,000.

Output

Print the last five digits of N! after removing all trailing zeros. If necessary, pad the result on the left with zeros so that the output has exactly five digits.