Tianjin University Online Judge
Contests Virtual Contests Problems Submit Runs Status Rank List Forum

3467.   3467
Time Limit: 2.0 Seconds   Memory Limit: 65536K
Total Runs: 2354   Accepted Runs: 1707



This is the 3467th problem of TOJ, Now given an integer N (1 ≤ N ≤ 2147483647), please coculate the sum of all its digits in decimal. For example, if N is 3467, then the answer is 3 + 4 + 6 + 7 = 20.

Input

The first line of the input is an integer T, representing the number of test cases. Then T lines follows, each line contain a single integer N.

Output

For each test cases, output a sigle integer: the sum of all digits of N.

Sample Input

2
1
2147483647

Sample Output

1
46



Source: TJU
Submit   List    Runs   Forum   Statistics

Tianjin University Online Judge v1.3.0
Maintance:G.D.Retop. Developer: SuperHacker, G.D.Retop