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