#include <iostream>
#include <vector>
#include <algorithm>
#include <numeric>
#include <set>
#include <map>
#include <string>
#include <stack>
#include <queue>
#include <cmath>
#include <cstdio>
#include <istream>
#include <sstream>
#include <iomanip>
#include <iterator>
#include <climits>
using namespace std;

typedef ostringstream OSS;
typedef istringstream ISS;

typedef vector<int> VI;
typedef vector< VI > VVI;

typedef long long LL;

typedef pair<int, int> PII;
typedef vector<PII> VPII;

#define X first
#define Y second

int fromString(const string s) { istringstream ist(s); int res; ist >> res; return res; }

// 複数文字split
vector<string> split(const string &str, const string &delim = " ") {
    size_t start = 0, pos;
    vector<string> result;
    
    while ( (pos = str.find_first_of( delim, start) ) != string::npos ) {
        if (pos - start != 0)
            result.push_back( str.substr( start, pos - start) );
        start = pos + 1;
    }
    if (str.size() - start != 0)
        result.push_back( str.substr( start, str.size() - start ) );

    return result;
}

int main(void) {
	string s;

	string abc(26 + 26, 'a');
	iota(abc.begin(), abc.begin() + 26, 'a');
	iota(abc.begin() + 26, abc.begin() + 26 + 26, 'A');
	abc += '.';

	int total = 0;

	while (cin >> s) {
		vector<string> nums = split(s, abc);

		for (auto num : nums) {
			total += fromString(num);
		}
	}

	cout << total << endl;

	return 0;
}