#include using namespace std; int main() { cin.sync_with_stdio(0), cin.tie(0), cout.tie(0); char c[10]; int a[10]; for (int i = 0; i < 3; i++) { cin >> c[i]; if (c[i] != '?') { a[i] = c[i] - '0'; } } if (c[0] == '?') { if (a[1] < a[2]) { cout << 4 << endl; } else { cout << 1 << endl; } } else if (c[2] == '?') { if (a[0] < a[1]) { cout << 1 << endl; } else { cout << 4 << endl; } } else { cout << 14 << endl; } }