The Head of Professor Integralov
From Monte Carlo, Kotyhoroshko and Pan Kotsky flew by plane to London, where Vernyhora was already waiting for them. Nearby was Professor Integralov, who had been invited to an international symposium. The professor decided to showcase his skill in performing complex mathematical calculations quickly and accurately. "Let's assume," said the professor, "that we have a natural number N. First, we calculate the factorial of this number, denoted as N!. Then, we find the sum of all the digits in N!. If this sum is greater than 9, we continue summing the digits of the resulting number until we obtain a single-digit number between 1 and 9. Understood?"
"Yes," replied Kotyhoroshko.
And then something remarkable happened. Regardless of the initial number Kotyhoroshko and Pan Kotsky mentioned, the professor, without hesitation, immediately provided the correct answer—a number from 1 to 9.
Your task is to write a program that can emulate the intellectual prowess of Professor Integralov.
Input
The first line of the input contains a single number N (1 ≤ N ≤ 10^9).
Output
Output the single number that Professor Integralov would have given to our heroes.