from random import shuffle n=int(input()) a=list(map(int,input().split())) ans=0 for i in range(400000): shuffle(a) cnt=0 for i in range(0,n,2): cnt+= a[i]^a[i+1] ans=max(ans,cnt) print(ans)