n=int(math.pow(2,int(input().strip()))) country=list(map(int,input().strip().split())) qian=sorted(country[:int(n/2)],reverse=True) hou=sorted(country[int(n/2+1):],reverse=True) print(int(country.index(min(qian[0],hou[0]))+1))