x=raw_input()
k=str(x)
sum=0
for n in range(0,len(k)):
    sum=sum+int(k[n])
print sum    

8ef3b68d9467b687cd61693919060791cccea502
x=raw_input()
k=str(x)
sum=0
for n in range(0,len(k)):
    sum=sum+int(k[n])
print sum    
