import Data.Bits

main = do
    n <- fmap read getLine
    as <- fmap ((map (read :: String -> Int)).words) getLine
    let answer = length $ filter (\(x, y) -> x == y || isOK x y) [(l, r) | l <- [1..n], r <- [1..n], l <= r]
           where isOK x y = (let as' = take (y-x+1) (drop (x-1) as) in (foldr1 xor as'  == sum as'))
    print answer
