Simple Maths

Not much to say, discover by yourself!

Input

1
37
456
1013
498934
26456821
1658
168813
3574
6557
815
147
65465456

Output

41
12
14
23
19
27
20
34
37
5
15
10
1