#include<iostream>
#include<string>
#include<algorithm>

using namespace std;

bool isNumber(char c);
bool isNotNumber(char c);
int Atoi(const string);

int main(){
  int num=0;
  string s, _s;
  string::iterator i, j;

  while(getline(cin, s)){
    j = s.begin();
    while(i != s.end() && j != s.end()){
      i = find_if(j, s.end(), isNumber);
      j = find_if(i, s.end(), isNotNumber);
      copy(i, j, back_inserter(_s));
      num += Atoi(_s);
      _s.clear();
    }
  }

  cout << num << endl;
  return 0;
}

bool isNumber(char c){
  if(c >= '0' && c <= '9')
    return true;
  else
    return false;
}

bool isNotNumber(char c){
  if(c >= '0' && c <= '9')
    return false;
  else
    return true;
}

int Atoi(const string c){
  int i, x=0, digit=1;

  for(i = c.size()-1; i >= 0; --i){
    x = x + (c[i] - 48) * digit;
    digit *= 10;
  }
  return x;
}