#include<iostream>
#include<string>
#include<vector>
#include<algorithm>
#include<cmath>
#include<stdio.h>
#include<queue>
#include <climits>
#include <map>
#include <set>
const int mod = 1e9 + 7;
const int INF = 1 << 20;
using namespace std;
typedef long long ll;
typedef pair<int,int> P;

int main()
{
    int ans = 0;
    while(true){
        string s;
        cin >> s;
        if(s=="\0") break;
        for(int i= 0; i < s.size(); i++){
            int a = 0;
            if(s[i] >= '0' && s[i] <= '9'){
                while(s[i] >= '0' && s[i] <= '9'){
                    a *= 10;
                    a += (s[i]-'0');
                    i++;
                }
                ans += a;
            }
        }
    }
    cout << ans << endl;
}
