from itertools import combinations N = int(input()) A = list(map(int,input().split())) dp = {} for z in combinations(range(N),2): dp[z] = A[z[0]]^A[z[1]] for n in range(4,N+1,2): for z in combinations(range(N),n): dp[z] = 0 for y in combinations(z,2): z1 = list(z) z1.remove(y[0]) z1.remove(y[1]) z1 = tuple(z1) dp[z] = max(dp[z],dp[z1]+(A[y[0]]^A[y[1]])) ans = tuple(range(N)) print(dp[ans])