C = input().split() idx = C.index("?") if idx==1: print(14) else: if C[1]=="2": print(4) else: print(1)