#include #include #include #include #include #include #include #include #include #include #include #include using namespace std; long long mod = 1e9 + 7; int main(void) { char c[3]; cin >> c[0] >> c[1] >> c[2]; if(c[0] == '?') { if(c[1] == '2') { cout << 4 << endl; }else{ cout << 1 << endl; } } if(c[1] == '?') { if(c[0] == '2') { cout << 14 << endl; }else{ cout << 14 << endl; } } if(c[2] == '?') { if(c[0] == '2') { cout << 1 << endl; }else{ cout << 4 << endl; } } return 0; } // EOF