As you know, to verify the licensed software used by the serial number and reshistratsionnye keys. You, as a leading developer of verification of license software was developed the idea of reliable in-a-kind system. It Is based on the digital roots of numbers. Now you need to write a program that defines the digital root of this number.
For an arbitrary number of digital root is defined as follows:
Input
One number n (0 ≤ n ≤ 231 - 1).
Output
Print one number - the answer to the challenge.
Example input123 |
Example output6 |