#include using namespace std; #include using namespace atcoder; using mint=modint998244353; //1000000007; using ll=long long; using pp=pair; #define sr string #define vc vector #define fi first #define se second #define rep(i,n) for(int i=0;i<(int)n;i++) #define pb push_back #define all(v) v.begin(),v.end() #define pque priority_queue #define bpc(a) __builtin_popcount(a) int main(){ int n;cin>>n; vca(n),b(n); rep(i,n)cin>>a[i]; rep(i,n)cin>>b[i]; int r=0,now=0; vcbb(n+1,0); rep(i,n)bb[i+1]=bb[i]^b[i]; vc bx(n+1,vc(2,0)); rep(i,n+1)bx[i][bb[i]]++; rep(i,n)rep(j,2)bx[i+1][j]+=bx[i][j]; ll ans=0; rep(l,n){ if(r<=l)r=l+1,now^=a[l]; while(r