#include <fstream>
#include <cstring>
using namespace std;
string s;
ifstream f1("bai5.inp");
ofstream f2("bai5b.out");
int main()
{
	long x = 1,tong = 0;
    getline(f1,s);
    for (long n = s.length()-1; n >= 0; n--)
	{
		if (int(s[n]) > 47 && int(s[n]) < 58) tong = tong + x * (int(s[n])-48);
		else continue;
		if (int(s[n-1]) > 47 && int(s[n-1]) < 58) x = x * 10;
		else x = 1;
	}
	f2 << tong;
    return 0;
}
