import Data.List
import Data.Bits
import Data.Maybe
import Control.Monad

eqRange :: [Int] -> Int
eqRange [] = 0
eqRange xs = fromMaybe (length xs) $ findIndex not $ zipWith (==) sums xors
  where sums = scanl1 (+) xs
        xors = scanl1 xor xs

countPairs :: [Int] -> Int
countPairs = sum . map eqRange . inits

main :: IO ()
main = do
  getLine
  as <- mapM readIO . words =<< getLine
  print $ countPairs as
