import std.stdio;
import std.algorithm;
import std.string;
import std.conv;
import std.math;

void main(){

    int ans = 0;
    while(true){
	auto s = readln();
	if(stdin.eof()) break;
	s = chomp(s);
	for(int i=0;i<s.length;i++){
	    char c = s[i];
	    if('1' <= c && c <= '9' ){
		int temp = 0;
		temp++;
		while('0' <= s[i+temp] && s[i+temp] <= '9'){
		    temp++;
		    if(i+temp==s.length) break;
		}
		ans += to!int(s[i..i+temp]);
		i += temp;
	    }
	}
    }
    writeln(ans);
}