a, b, c = map(str, input().split()) a_list = [a,b,c] index = a_list.index("?") if index == 0: if a_list[1] == '3': print('1') else: print('4') else: print('14')