num=int(input())
sum_n=num%10 + num//10%10 + num//100%10 + num//1000
print(sum_n)