c = input().split() if c[0] == '?' or c[2] == '?': if c[1] == '2': print('4') else: print('1') else: print('14')