import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner s = new Scanner(System.in);
String st;
int now, last;
while (true) {
st = s.nextLine();
last = 0;
for (int i = 0; i < st.length(); i ++) {
now = countNum(st.charAt(i));
if (now > 0&&now != last) {
System.out.print(now);
}
last = now;
}
System.out.println();
}
}
private static int countNum(char a) {
if(a=='B'||a=='F'||a=='P'||a=='V') return 1;
if(a=='C'||a=='G'||a=='J'||a=='K'||a=='Q'||a=='S'||a=='X'||a=='Z') return 2;
if(a=='D'||a=='T') return 3;
if(a=='L') return 4;
if(a=='M'||a=='N') return 5;
if(a=='R') return 6;
else return 0;
}
}