#include<iostream>
#include<string>
#define rep(i,a) for(int i = 0 ; i < a ; i ++)

using namespace std;

int main(void){
  string str;
  int sum=0;
  while(cin>>str){
    int next=0;
    rep(i,str.size()){
      if('0'<=str[i]&&str[i]<='9'){
	if('0'<=str[i+1]&&str[i+1]<='9'){
	  next = next * 10 + (str[i] - '0') ;
	  //	  cout<<next<<" "<<str[i]<<endl;
	}else if('0'<=str[i-1]&&str[i-1]<='9' || !('0'<=str[i+1]&&str[i+1]<='9')){
	  
	  //	  cout<<next*10+str[i]-'0'<<endl;
	  sum+=next*10+str[i]-'0';next=0;
	}
      }
    }

  }
  cout<<sum<<endl;
}