1 #include <iostream>
2 #include <cstdio>
3 #include <cstdlib>
4 #include <cmath>
5 #include <cctype>
6 #include <cstring>
7
8 #include <vector>
9 #include <deque>
10 #include <list>
11 #include <map>
12 #include <set>
13 #include <stack>
14 #include <queue>
15 #include <algorithm>
16 #include <string>
17
18
19 #define MAXD 99999999
20 using namespace std;
21
22
23
24 map<string,int>mp;
25
26
27
28
29
30 int main()
31 {
32
33 mp["zero"]=0;
34 mp["one"]=1;
35 mp["two"]=2;
36 mp["three"]=3;
37 mp["four"]=4;
38 mp["five"]=5;
39 mp["six"]=6;
40 mp["seven"]=7;
41 mp["eight"]=8;
42 mp["nine"]=9;
43
44 int i,j,k;
45 int n;
46
47
48 char s[1000];
49
50
51 while(gets(s))
52 {
53 int a,b;
54
55
56 i=0;
57
58
59 int temp=0;
60
61 while(s[i]!='+')
62 {
63 string ts="";
64
65 while(s[i]!=' ')
66 {
67
68
69 ts+=s[i];
70 i++;
71 }
72
73 temp*=10;
74 temp+=mp[ts];
75 i++;
76 }
77
78
79
80 a=temp;
81
82
83
84
85 temp=0;
86
87
88
89
90 i++;
91 i++;
92
93
94 while(s[i]!='=')
95 {
96
97 string ts="";
98
99 while(s[i]!=' ')
100 {
101
102
103
104
105 ts+=s[i];
106
107 i++;
108 }
109
110
111 temp*=10;
112 temp+=mp[ts];
113 i++;
114 }
115
116
117 b=temp;
118
119
120
121 int c=a+b;
122
123 if(c==0)
124 break;
125 else
126 cout<<c<<endl;
127 }
128
129
130
131
132
133
134 return 0;
135 }