import sys input = sys.stdin.readline N=int(input()) A=list(map(int,input().split())) if N>=16: print(2**16-1) exit() DP=[0]*(1<