N=int(input()) for i in range(0,N-1,2): print("?",i,i+1, flush=True) z=int(input()) if z==i: print(i+1) break elif z==i+1: print(i) break else: print(N-1)