#C7824. Sum of Digits

    ID: 51738 Type: Default 1000ms 256MiB

Sum of Digits

Sum of Digits

Given a positive integer (n), compute the sum of its digits. If (n < 10), then the answer is simply (n) itself. Otherwise, compute (\sum_{i=1}^{k} d_i) where (d_i) are the digits of (n). For example, if (n = 1234), then the output should be (1 + 2 + 3 + 4 = 10).

inputFormat

The input consists of a single line containing a positive integer (n).

outputFormat

Output a single integer that is the sum of the digits of (n), or (n) itself if it is less than 10.## sample

5
5

</p>