import Data.Bits
f _ _ [] [] = 0
f n x ~yys@(y:ys) zzs
  | not (null zzs) && x+z == x`xor`z = f (n+1) (x`xor`z) yys zs
  | otherwise = n + f (n-1) (x`xor`y) ys zzs
  where ~(z:zs) = zzs
main = do
  n <- getLine
  a <- map read . words <$> getLine :: IO [Int]
  print $ f 0 0 a a