s = input() n = 0 for i in range(len(s)): if int(s[i]): n += int(s[i]) print(n)