#include #define length 10000 int sumall(char s[],int size); int main() { char s[length]={0}; int ans; scanf("%s",s); ans=sumall(s,length); printf("%d\n",ans); return 0; } int sumall(char s[],int size) { int i,ans=0; for(i=0;s[i]!='\0';i++){ if('0'<=s[i] && s[i]<='9'){ ans=ans+(int)s[i]-'0'; } } return ans; }