hs={} hs["?23"]=4 hs["?32"]=1 hs["2?3"]=14 hs["3?2"]=14 hs["23?"]=1 hs["32?"]=4 puts hs[gets.chomp.gsub(" ","")]