#C11797. Digital Root Computation

    ID: 41152 Type: Default 1000ms 256MiB

Digital Root Computation

Digital Root Computation

Given a non-negative integer \(n\), repeatedly sum the digits of \(n\) until a single-digit number is obtained. This final single-digit number is known as the digital root of \(n\). For example, if \(n = 5432\), then:

\(5 + 4 + 3 + 2 = 14\) and \(1 + 4 = 5\), so the digital root is 5.

Your task is to compute the digital root of the input integer.

inputFormat

The input consists of a single line containing a non-negative integer \(n\) (\(0 \le n \le 10^{18}\)). The number is provided via stdin.

outputFormat

Output a single integer representing the digital root of \(n\) to stdout.

## sample
5432
5