#include using namespace std; int main() { // 1. 入力情報取得. char c1, c2, c3; cin >> c1 >> c2 >> c3; // 2. 門松列のパターンを確認. string ans = "0"; if(c1 == '?' && c2 == '2' && c3 == '3') ans = {'4'}; if(c1 == '?' && c2 == '3' && c3 == '2') ans = {'1'}; if(c1 == '2' && c2 == '?' && c3 == '3') ans = "14"; if(c1 == '2' && c2 == '3' && c3 == '?') ans = {'1'}; if(c1 == '3' && c2 == '?' && c3 == '2') ans = "14"; if(c1 == '3' && c2 == '2' && c3 == '?') ans = {'4'}; // 3. 出力. cout << ans << endl; return 0; }