Valuable digit

Valuable digit

You cannot submit for this problem because the contest is ended. You can click "Open in Problem Set" to view this problem in normal mode.

Time Limit: 2.0 s

Memory Limit: 256.0 MB

Description

After a month of mining for a valuable metal named "digit" , Alice found a stone containing some digits.
There are 10 types of digits which are '0' , '1' , '2' ..... '8' , '9'.

price of a type of digit is the same as the integer version of it. such as price of '0' is 0 , '1' is 1 and so on.

What Alice found is a stone mixed with some digit and some other unnecessary minerals.

Alice wants to know the total value of his found stone. Can you help him ?

Input

First line takes an integer \(T\) : Number of testcases
each of next \(T\) lines takes a string \(S\) which describes the stone which alice found
\(1 <= T <= 10\)
\(1 <= |S| <= 100\)

Output

print \(T\) integer in each of \(T\) line : The value of the found string of alice.

Sample

Input Output
3
a3t82ac4
h3110wor1d
31um1n4t150flu
17
6
15

in the first testcase : "a3t82ac4"
the total value of the stone is 3+8+2+4 = 17

Brain Booster #4

Not Attended
Status
Done
Rule
ACM/ICPC
Problem
9
Start at
2024-07-14 15:30
End at
2024-07-14 19:00
Duration
3.5 hour(s)
Host
Partic.
89