Sum of digits of a number
Kotlin
Easy
math
Task «Sum of digits of a number»
Write a program that calculates the sum of digits of a positive integer. The number can be large, up to 10^9. If the number is a single digit, the sum is equal to the number itself. Output the result.
Input Format
In a single line, an integer N (1 ≤ N ≤ 10^9) is entered.
Output Format
One integer — the sum of the digits of the number N.
Examples
Example 1
INPUT
1000
OUTPUT
1
Example 2
INPUT
5
OUTPUT
5
main.kt