N = int(input()) A = [0]+list(map(int,input().split())) dp = [[0 for _ in range(2**15)] for _ in range(2)] dp[0][0] = 1 dp[1][0] = 1 dp[1][A[1]] = 1 for i in range(2,N+1): for j in range(1,2**15): dp[i%2][j] = max(dp[(i-1)%2][j],dp[(i-1)%2][j^A[i]]) ans = 0 for j in range(2**15): ans += dp[N%2][j] print(ans)