#include "bits/stdc++.h" using namespace std; int main() { char c1, c2, c3; cin >> c1 >> c2 >> c3; if (c1 == '?' || c3 == '?') { if (c2 == '2') cout << 1; else cout << 4; } else cout << 14; cout << endl; }