Repeated Digit Sum
Repeatedly replace \(N\) by the sum of its decimal digits until one digit remains.
Input
One line containing \(N\).
The input satisfies:
- \(0 \le N \le 10^9\)
Output
Print the final one-digit value.
Example
Input
0
Output
0
Repeatedly replace \(N\) by the sum of its decimal digits until one digit remains.
One line containing \(N\).
The input satisfies:
Print the final one-digit value.
0
0
Comments