n=int(input())
str1=str(n)
sum=0
for i in str1:
    sum+=int(i)
print(sum)
#在这里,我们可以用字符串来一位一位的取,这是一个技巧,
把一个整数变成一个字符串后,就直接一位一位的取每位的数字