#include "bits/stdc++.h"
#include<unordered_map>
#include<unordered_set>
#pragma warning(disable:4996)
using namespace std;
using ld = long double;
const ld eps = 1e-9;

vector<string>sts{
	"light fly!	    00.00kg@48.00 kg ",
	"fly!	        48.00kg@51.00 kg ",
	"bantam!	    51.00kg@54.00 kg ",
	"feather!	    54.00kg@57.00 kg ",
	"light!	        57.00kg@60.00 kg ",
	"light welter!	60.00kg@64.00 kg ",
	"welter!	    64.00kg@69.00 kg ",
	"light middle!	69.00kg@75.00 kg ",
	"middle!	    75.00kg@81.00 kg ",
	"light heavy!	81.00kg@91.00 kg ",
	"heavy!	        91.00kg@99999 kg ",
};

int main() {
	string st;
	int ans = 0;
	while (cin >> st) {
		int num=0;
		for (auto c : st) {
			if (isdigit(c)) {
				num*=10;
				num+=c-'0';
			}
			else {
				ans+=num;
				num=0;
			}
		}
	}
	cout<<ans<<endl;
	return 0;
}
