#include <iostream>
#include <vector>
#include <list>
#include <algorithm>
#include <string>
#include <stack>
#include <iomanip>
#include <numeric>
#include <queue>
#include <climits>
#include <set>
#include <complex>
#include <cmath>
#include <map>
using namespace std;
using ll = long long;
#define MOD 1000000007
#define INF 1LL << 59

int main()
{
    std::ios::sync_with_stdio(false);
    std::cin.tie(0);
    //cout << fixed << setprecision(7);

    string s;
    int ans = 0;
    while (getline(cin, s))
    {
        int n = s.size();

        int sum = 0;
        for (int i = 0; i < n; ++i)
        {
            if (s[i] >= '0' && s[i] <= '9')
            {
                sum = sum * 10 + s[i] - '0';
            }
            else
            {
                ans += sum;
                sum = 0;
            }
        }
        ans += sum;
    }
    cout << ans << endl;
    return 0;
}
