from numpy import *;i=int32;q=searchsorted;n,*x=map(int,open(0).read().split());A,B,c=i(x[:n]),i(x[n:]),0;
for k in range(1,30):
  a,b=sort(hstack((A%(1<<k),A%(1<<k)-2**k))),B%(1<<k);c+=(sum(q(a,2**k-b)-q(a,2**(k-1)-b)))%2<<k-1
print(c)
