#include<iostream>
#include<cctype>
using namespace std;
int main(){
  string a;
  int sum=0;
  int st=0;
  while(cin>>a){
    if(a=="00")break;
    for(int i=0;i<a.size()-1;i++){
      if(isdigit(a[i])){st*=10;st+=a[i]-'0';}
      if(i!=a.size()-1&&!isdigit(a[i+1])){sum+=st;/*cout<<st<<endl;*/st=0;}
    }
  }
  cout<<sum<<endl;
}