def main():
num = int(input())
summ = 0
while num > 0:
summ += num % 10
num //= 10
print(summ)
main()
def main():
num = int(input())
summ = 0
while num > 0:
summ += num % 10
num //= 10
print(summ)
main()