import sys input = sys.stdin.readline N=int(input()) A=list(map(int,input().split())) B=list(map(int,input().split())) XOR=[0] for b in B: XOR.append(XOR[-1]^b) SA=[0] SB=[0] for i in range(1,N+1): if XOR[i]==0: SA.append(SA[-1]+1) SB.append(SB[-1]) else: SA.append(SA[-1]) SB.append(SB[-1]+1) ANS=0 UA=0 XA=0 ind=0 for i in range(N): while True: if ind