#include <iostream>
#include <string>

using namespace std;

string num[10] = {"0", "1", "2", "3", "4", "5", "6", "7", "8", "9"};

int main(int argc, char **argv)
{
	string str;
	int sum = 0;
	
	while(cin >> str){
		int n = str.size();
		for(int i = 0, f = 0; i < n; f = 0){
			string s = str.substr(i, 1);
			string st = "";
			for(int j = 0; j < 10 && i < n;){
				if(s == num[j]){
					st += s;
					i++;
					f = 1;
					s = str.substr(i, 1);
					j = 0;
				} else {
					j++;
				}
			}
			sum += atoi(st.c_str());
			if(f == 0){
				i++;
			}
		}
	}
	cout << sum << endl;
	
	return 0;
}