import sys input = sys.stdin.readline N=int(input()) A=list(map(int,input().split())) ALL=N*(N+1)//2 ANS=0 for i in range(30): score=0 now=0 for a in A: if a & (1<