#C5423. Recursive Sum of Digits

    ID: 49071 Type: Default 1000ms 256MiB

Recursive Sum of Digits

Recursive Sum of Digits

Given a non-negative integer \( n \), repeatedly sum its digits until the result is a single-digit number. The process is defined recursively. For example, if \( n = 12345 \), then the sum of digits is \( 1+2+3+4+5 = 15 \) and further summing \( 1+5 = 6 \). Your task is to implement this recursive procedure.

The solution should read input from stdin and output the result to stdout.

inputFormat

The input consists of a single non-negative integer \( n \) provided via stdin. You may assume that \( n \) is at most 1030 and given in its decimal form.

outputFormat

The output is a single-digit number, printed to stdout, which is obtained by recursively summing the digits of the input until a single-digit number is reached.

## sample
5
5