/**/
#include <cstdio>
#include <cstring>
#include <cmath>
#include <cctype>
#include <iostream>
#include <algorithm>
#include <map>
#include <set>
#include <vector>
#include <string>
#include <stack>
#include <queue>
#include <sstream>

typedef long long LL;
using namespace std;

string s;
string num[11];

int main()
{
	//freopen("in.txt", "r", stdin);
	//freopen("out.txt", "w", stdout);

	num[0] = "zero";
	num[1] = "one";
	num[2] = "two";
	num[3] = "three";
	num[4] = "four";
	num[5] = "five";
	num[6] = "six";
	num[7] = "seven";
	num[8] = "eight";
	num[9] = "nine";
	num[10] = "ten";
	while(getline(cin, s)){
		int a = 0, b = 0;
		int len = s.size();
		int l = 0, r = 0;
		int flag = 0;
		for (int i = 0; i < len; i++){
			if(s[i] == ' ' && !flag){
				r = i - 1;
				string str;
				int temp;
				str = s.substr(l, r - l + 1);
				for (int j = 0; j <= 10; j++){
					if(num[j] == str){
						temp = j;
						break;
					}
				}
				a = a * 10 + temp;
				l = i + 1;
			}
			if(s[i] == '+') {
				flag = 1;
				l = i + 2;
			}
			if(s[i] == ' ' && s[i - 1] != '+' && flag){
				r = i - 1;
				string str;
				int temp;
				str = s.substr(l, r - l + 1);
				for (int j = 0; j <= 10; j++){
					if(num[j] == str){
						temp = j;
						break;
					}
				}
				b = b * 10 + temp;
				l = i + 1;
			}
		}
		if(!a && !b) break;
		else{
			printf("%d\n", a + b);
		}
	}

	return 0;
}
/**/