#include typedef long long ll; using namespace std; int INF = 1LL << 30; int MOD = 1e9+7; main(){ string a,b,c; cin >> a >> b >> c; if (b == "?")cout << "14" << endl; else if (b == "2")cout << "4" << endl; else cout << "1" << endl; }