# -*- coding: utf-8 -*- __author__ = 'yuuki' #No.289 数字を全て足そう S = raw_input() N = ['1','2','3','4','5','6','7','8','9'] M = 0 for i in xrange(len(S)): for c in range(len(N)): if S[i] == N[c]: M += int(S[i]) break print M