#include int main() { char str[10000] = {'\0'}; scanf("%s", str); int i, ans; for (i = 0; i < 10000; i++) { switch (str[i]) { case '1': ans += 1; break; case '2': ans += 2; break; case '3': ans += 3; break; case '4': ans += 4; break; case '5': ans += 5; break; case '6': ans += 6; break; case '7': ans += 7; break; case '8': ans += 8; break; case '9': ans += 9; break; } if (str[i] == '\0') { break; } } printf("%d\n", ans); return 0; }