T=int(input())
N=[]
c=[]
s=0
for i in range(0,T):
d=int(input())
N.append(d)
for i in range(0,T):
while N[i]>0:
d=N[i]%10
s=s+d
N[i]=N[i]//10
c.append(s)
s=0
for i in c:
print(i)
Traceback (most recent call last):
File “./prog.py”, line 1, in
EOFError: EOF when reading a line