import java.util.HashMap;
import java.util.Map;
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
Map<String, Integer> map = new HashMap<>();
map.put("zero", 0);
map.put("one", 1);
map.put("two", 2);
map.put("three", 3);
map.put("four", 4);
map.put("five", 5);
map.put("six", 6);
map.put("seven", 7);
map.put("eight", 8);
map.put("nine", 9);
map.put("ten", 10);
while (sc.hasNextLine()) {
String[] s = sc.nextLine().split(" ");
int a = 0, b = 0, i;
for (i = 0; !s[i].equals("+"); i++) a = a * 10 + map.get(s[i]);
for (++i; !s[i].equals("="); i++) b = b * 10 + map.get(s[i]);
if (a + b == 0) break;
System.out.println(a + b);
}
}
}