import re,math regex = re.compile(r'[a-z]*') ans = 0 string = input() string = str(string) mo = regex.search(string) number = string.replace(mo.group(), '0') 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)