cho.sh
Notes
Loading...

Last Non-Zero Factorial Digit 2

Time limit

1s

Memory limit

128 MB

Problem

For a natural number N, consider N!. Remove all trailing zeros from its decimal representation, then find the last remaining digit.

Input

The first line contains a natural number N. N has at most 100 decimal digits.

Output

Print the last remaining digit after removing all trailing zeros from N!.