#include <fstream>
#include <iostream>
#include <sstream>
#include <string>
using namespace std;
int main()
{
    ifstream fi("tinhtong.inp");
    ofstream fo("tinhtong.out");
    string s,s1 = "";
    int t = 0;
    getline(fi,s);
    while (s[0] == 32) s.erase(0,1);
    while (s[s.length()-1] == 32) s.erase(s.length()-1,1);
    s += "a";
    for (int i = 0; i < s.length(); i++)
    {
        if (s[i] <= 57 && s[i] >= 48) {s1 += s[i];}
        else
            {
                int tg = 0;
                istringstream c(s1);
                c >> tg;
                s1 = "";
                t += tg;
            }
    }
    fo << t;
    return 0;
}

