N = int(input()) A = list(map(int,input().split())) dp = [0] * (1 << N) def popcnt(x): res = 0 while x: res += (x & 1) x >>= 1 return res for status in range(1 << N): if popcnt(status) & 1: continue for i in range(N): if (status >> i) & 1: continue for j in range(i + 1, N): if (status >> j) & 1: continue next_status = status | (1 << i) | (1 << j) dp[next_status] = max(dp[next_status], dp[status] + (A[i] ^ A[j])) print(dp[-1])