Write a program which reads an integer and prints sum of its digits.
list1 = []
while True:
    x = int(input())
    if x == 0:
        break
    else:
       list1.append(x)

sum(list1)
list1 = []
while True:
    x = str(input())
    if x == '0':
        break
    else:
        result=0
        for i in x:
            result += int(i)
        list1.append(result)
            
for i in list1:
    print(i)