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 = (let as' = take (y-x+1) (drop (x-1) as) in (foldr1 xor as'  == sum as'))
    print answer