E. Last digit
time limit per test
5 seconds
memory limit per test
256 megabytes
input
standard input
output
standard output

The statement of this problem is very simple: find the last non-zero digit in the number $$$1^1 \cdot 2^2 \cdot 3^3 ... \cdot n^n$$$.

Input

Input contains one integer number $$$n$$$ ($$$1 \le n \le 10^6$$$).

Output

Output one integer number from 1 to 9.

Example
Input
5
Output
4