import sequtils,strutils var C = stdin.readline.split if C[1] == "?": echo 14 elif C[0] == "?" and C[2] == "3": echo 4 elif C[0] == "?": echo 1 elif C[2] == "?" and C[0] == "3": echo 4 else: echo 1