#include int main(void) { char a, b, c; scanf("%c%c%c\n", &a, &b, &c); if(b == '?') printf("14"); else if(b == '2') printf("4"); else if(b == '3') printf("1"); return 0; }