#include <iostream>
#include <string>

using namespace std;

int check(string &inp)
{
    int ret = 0, tmp = 0;
    bool flag = false;

    inp += '.';
    
    for (int i = 0; i < inp.size(); i++) {
        if (isdigit(inp[i])) {
            if (flag) {
                tmp *= 10;
                tmp += inp[i] - '0';
            }
            else {
                tmp = inp[i] - '0';
                flag = true;
            }
        }
        else if (flag) {
            ret += tmp;
            flag = false;
        }
    }
    return ret;
}

int main()
{
    int ans = 0;
    string inp;

    while (cin >> inp) 
        ans += check(inp);
    cout << ans << endl;

    return 0;
}