In numerology, people keep adding the digits of a number until a single digit is left. This is called the digital root.
Example: 9875 → 9+8+7+5 = 29 → 2+9 = 11 → 1+1 = 2.
Given n, find its digital root.
Input Format
A single integer n.
Output Format
Print the digital root.
Constraints
• 0 ≤ n ≤ 10^18
Examples
Example 1
Explanation 9875 → 29 → 11 → 2.
Example 2
Explanation 3 + 8 = 11 → 1 + 1 = 2.
Example 3
Explanation Already a single digit.
Acceptance
—
Accepted
0
Submissions
0