Count Digit SumEasy

Count Digit Sum

EasyPractice library · +10 XPstringsloopsparsing

Given a string consisting of digits ('0'-'9'), calculate the sum of the integer values of all its digits.

Input

A single line containing a string S, where S consists only of characters '0' through '9'.

Output

A single integer, the sum of the digits in S.

Constraints

The length of S is between 1 and 1000, inclusive.

Time limit 1 s (native code; slower languages get more)Memory 256 MB13 hidden tests

Example 1

Input
12345
Output
15

The sum of digits 1, 2, 3, 4, 5 is 15.

Example 2

Input
901
Output
10

The sum of digits 9, 0, 1 is 10.

Hints