#include <bits/stdc++.h>
#define rep(i,j,k) for(int i=(int)j;i<(int)k;i++)
#define itrep(x) for(auto it=(x).begin();it!=(x).end();it++)
#define Sort(x) sort((x).begin(),(x).end())
#define all(x) (x).begin(),(x).end()
#define fi first
#define se second
#define vi vector<int>
#define INF (int)1e9
#define INFL 1e18
//#define MOD 1000000007
#define pb push_back
#define MP make_pair
#define PI 3.1415926535
typedef long long int ll;
typedef std::pair<int,int> P;
int D=1;
int dx[4]={0,1,0,-1},dy[4]={1,0,-1,0};

using namespace std;

int main(){
    string s;
    int ans=0;
    while(cin>>s){
        reverse(all(s));
        string t="";
        rep(i,0,s.size()){
            if('0'<=s[i] && s[i]<='9'){
                int count=0;
                ans+=(s[i]-'0')*pow(10,count);
                while(i+1<s.size() && '0'<=s[i+1] && s[i+1]<='9'){
                   count++;
                   ans+=(s[i+1]-'0')*pow(10,count);
                   i++;
                }
            }
        }
    }
    cout<<ans<<endl;
    
    return 0;
}

