#C11590. Sum of Digits

    ID: 40923 Type: Default 1000ms 256MiB

Sum of Digits

Sum of Digits

Given a positive integer N, your task is to compute the sum of its digits.

For example, if N is 123, then the sum is 1 + 2 + 3 = 6. If N is 98765, then the sum is 9 + 8 + 7 + 6 + 5 = 35.

Note: The input will be given via standard input and the output should be printed to standard output.

Mathematical Formula: \( \text{sum} = \sum_{i=0}^{k-1} d_i \) where \( d_i \) are the digits of N.

inputFormat

The input consists of a single line containing a positive integer N.

Example:

123

outputFormat

The output is a single integer representing the sum of the digits of N.

Example:

6
## sample
5
5