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 = (length (takeWhile (<= tmp1) tmp2) == length as') && (tmp1 == last tmp2) 
                  where as' = take (y-x+1) (drop (x-1) as)
                        tmp1 = sum as'
                        tmp2 = scanl1 xor as'
    print answer