#K89282. Digital Root Computation
Digital Root Computation
Digital Root Computation
Given a positive integer n, compute its digital root. The digital root is found by repeatedly summing the digits of the number until a single digit remains.
For example, given n = 9875:
Step 1: 9 + 8 + 7 + 5 = 29
Step 2: 2 + 9 = 11
Step 3: 1 + 1 = 2
Thus, the digital root of 9875 is 2.
Solve the problem by reading the input from standard input (stdin) and printing the output to standard output (stdout).
inputFormat
The input consists of a single positive integer n provided through standard input.
outputFormat
Output the digital root of n to standard output.
## sample5
5