#include #include #include using namespace atcoder; using mint = modint1000000007; using namespace std; #define rep(i,n) for (int i = 0; i < (n); ++i) #define Inf 1000000001 unsigned long xor128() { static unsigned long x=123456789, y=362436069, z=521288629, w=88675123; unsigned long t=(x^(x<<11)); x=y; y=z; z=w; return (w=(w^(w>>19))^(t^(t>>8))); } vector get(){ vector h(1000001,0); rep(i,h.size())h[i] = xor128(); vector a(1000001,0); vector f(1000001,true); for(int i=2;i>n; pair sum(0,0); long long ans = 0LL; map,long long> mp; mp[sum] ++; rep(i,n){ long long x; cin>>x; sum.first ^= a[x]; sum.second ^= b[x]; ans += mp[sum]; mp[sum]++; } cout<