import Data.Bits
 
main = do
    n <- fmap read getLine
    as <- fmap ((map (read :: String -> Int)).words) getLine
    let answer = n + length [(l, r) | l <- [1..n], r <- [1..n], l < r, isOK l r]
       	  where isOK x y = last (takeWhile (<= tmp) $ scanl1 xor as') == tmp
                  where as' = take (y-x+1) (drop (x-1) as)
                        tmp = sum as'
    print answer