#include int main(void) { int i = 0, sum = 0 , tmp; char str[10000]; scanf("%s", str); while(str[i] != '\0') i++; i -= 1; while(i >= 0){ tmp = str[i] - '0'; if(tmp >= 0 && tmp <= 9){ sum += tmp; } i--; } printf("%d\n", sum); }