#include<iostream>
#include<string>
#include<deque>
using namespace std;
int main() {
	string s;
	int sum = 0;
	while (cin >> s){
		deque<int>l;
		for (int i = 0; i < s.size(); i++){
			char c = s[i];
			if (c == '0' || c == '1' || c == '2' || c == '3' || c == '4' || c == '5' || c == '6' || c == '7' || c == '8' || c == '9')
				l.push_front(c - '0');
			else if (!l.empty()){
				for (int i = 0; i < l.size(); i++){
					int t = 1;
					for (int j = 0; j < i; j++) {
						t *= 10;
					}
					t *= l[i];
					sum += t;
				}
				l.clear();
			}
		}
	}
	cout << sum << endl;
}