#include #include using namespace std; int main() { string s1, s2, s3; cin >> s1 >> s2 >> s3; if (s1 == "?" && s2 == "2") { //?23の入力なら4 cout << "4" << endl; } else if (s1 == "?" && s2 == "3") { //?32 cout << "1" << endl; } else if (s2 == "?" && s1 == "2") { //2?3 ->>213 243 cout << "14" << endl; } else if (s2 == "?" && s1 == "3") { //3?2 ->> 312 342 cout << "14" << endl; } else if (s3 == "?" && s1 == "2") { //23? cout << "1" << endl; } else if (s3 == "?" && s1 == "3") { //32? cout << "4" << endl; } return 0; }