import qualified Data.Bits as Bits
import qualified Data.ByteString.Char8 as BS
import qualified Data.Char as Char
import qualified Data.Text as Text
import qualified Data.Text.IO as Text
import qualified Data.Vector.Unboxed.Mutable as UMVector
import qualified Data.Vector.Unboxed as UVector
import Data.Vector.Unboxed ((!))

xorLengths :: UVector.Vector Int -> Int -> Int -> Int -> [Int] -> [Int]
xorLengths as i l xorVal acc
	| i >= len = acc
	| i + l >= len = xorLengths as (i + 1) (l - 1) nextXor (l:acc)
	| xorVal' == xorVal + next = xorLengths as i (l + 1) xorVal' acc
	| otherwise = xorLengths as (i + 1) (l - 1) nextXor (l:acc)
	where
		len = UVector.length as
		current = as ! i
		next = as ! (i + l)
		xorVal' = xorVal `Bits.xor` next
		nextXor = xorVal `Bits.xor` current

main :: IO ()
main = do
	n <- readLn
	as <- UVector.unfoldrN n (BS.readInt . BS.dropWhile Char.isSpace) <$> BS.getLine
	print $ sum $ xorLengths as 0 0 0 []
