#include <stdio.h>
int main(){
    int i=0;
    char s[101];
    scanf("%s", s);

    while(s[i]!='\0'){
        if(s[i]=='A') s[i]='4';
        if(s[i]=='E') s[i]='3';
        if(s[i]=='G') s[i]='6';
        if(s[i]=='I') s[i]='1';
        if(s[i]=='O') s[i]='0';
        if(s[i]=='S') s[i]='5';
        if(s[i]=='Z') s[i]='2';
        i++;
    }

    printf("%s\n", s);
    return 0;
}