import re,math regex = re.compile(r'[a-z]*') ans = 0 string = input() string = str(string) mo = regex.sub('0',string) number = mo math_len = len(number) number = int(number) for i in range(math_len): num = number % 10 number = math.floor(number / 10) ans += num print(ans)