import sys

for line in sys.stdin:
    a = str(line.split()[0])
    print(sum(int(i) for i in a ))