//传送门:http://acm.hdu.edu.cn/showproblem.php?pid=1228
#include <queue>
#include <functional>
#include <stdio.h>
#include <string.h>
#include <iostream>
#include <algorithm>
#include <stack>
#include <vector>
#include <set>
#include <map>
#include <string>
#include <cmath>
#include <cstdlib>
#include <ctime>
#include <assert.h>
using namespace std;
#define N 15
string s;
string tmp[N]={"zero","one","two","three","four","five","six","seven","eight","nine"};
//利用字符串数组更方便操作
int main()
{
while(1){
int a=0;
while(cin>>s,s!="+"){ //以 "+" 分隔两个数字
for(int i=0;i<10;i++){
if(s==tmp[i]){
a=a*10+i;
break;
}
}
}
int b=0;
while(cin>>s,s!="="){ //以 "=" 标志第二个数字输入结束
for(int i=0;i<10;i++){
if(s==tmp[i]){
b=b*10+i;
break;
}
}
}
if(a+b==0) break;
cout<<a+b<<endl;
}
return 0;
}