// No.289 数字を全て足そう // https://yukicoder.me/problems/no/289 // using namespace std; #include int solve(string &S); int main() { string S; cin >> S; int ans = solve(S); cout << ans << endl; } int solve(string &S) { int ans = 0; for (char c: S) { if (isdigit(c)) { ans += c - '0'; } } return ans; }