N=input();M=30;B=[0]*30;A=map(int,raw_input().split()) while M:M-=1;B[M]=sum((a>>M)&1 for a in A) x=sum(1<