#K70017. Digital Sum Reduction
Digital Sum Reduction
Digital Sum Reduction
This problem requires you to compute the digital root of an integer, i.e. repeatedly summing the digits of the number until a single-digit number is obtained. The process is as follows:
Given an integer \( n \), repeatedly compute the sum of its digits until the resulting sum is a single digit (i.e., less than 10), and output that digit.
For instance, given \( n = 9875 \), the computation proceeds as:
\( 9 + 8 + 7 + 5 = 29 \), then \( 2 + 9 = 11 \), and finally \( 1 + 1 = 2 \). Thus, the output is 2.
inputFormat
The input is provided in stdin and consists of a single integer \( n \) where \( 0 \le n \le 10^{20} \).
outputFormat
Output the single-digit digital root of the given integer. The output should be written to stdout.
## sample9875
2
</p>