Hide
Problem H
Sum of Digits
Write a program that, given an integer $n$ as input, computes the sum of all the digits of $n$.
Input
Input consists of one line with one integer $n$, where $0 \leq n \leq 10^{18}$.
Output
Output one line with one integer, the sum of all the digits of $n$.
Sample Input 1 | Sample Output 1 |
---|---|
192 |
12 |
Sample Input 2 | Sample Output 2 |
---|---|
11111 |
5 |
Sample Input 3 | Sample Output 3 |
---|---|
158931876357 |
63 |
Sample Input 4 | Sample Output 4 |
---|---|
0 |
0 |
Sample Input 5 | Sample Output 5 |
---|---|
123456789 |
45 |