/* -*- coding: utf-8 -*- * * 289.cc: No.289 数字を全て足そう - yukicoder */ #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include using namespace std; /* constant */ /* typedef */ /* global variables */ /* subroutines */ /* main */ int main() { string s; cin >> s; int sum = 0; for (int i = 0; i < s.size(); i++) { int d = s[i] - '0'; if (d >= 0 && d <= 9) sum += d; } printf("%d\n", sum); return 0; }