#include <iostream>
#include <string>
using namespace std;

int read_num(string s) {
    int count = 0;
    int buf = 0;
    bool prev_is_num = false;
    for (int i = 0; i < s.size(); i++) {
        if (isdigit(s[i])) {
            if (prev_is_num) {
                buf = buf * 10 + s[i] - '0';
            } else {
                prev_is_num = true;
                buf = s[i] - '0';
            } 
        } else {
            if (prev_is_num) {
                count += buf;
                buf = 0;
                prev_is_num = false;
            }
        }
    }
    return count;
}

int main() {
    string s;
    int count = 0;
    while (cin >> s) {
        count += read_num(s);
    }
    cout << count << endl;
}