{"trustable":true,"prependHtml":"\u003cstyle type\u003d\u0027text/css\u0027\u003e\n .input, .output {\n border: 1px solid #888888;\n }\n .output {\n margin-bottom: 1em;\n position: relative;\n top: -1px;\n }\n .output pre, .input pre {\n background-color: #EFEFEF;\n line-height: 1.25em;\n margin: 0;\n padding: 0.25em;\n }\n \u003c/style\u003e\n \u003clink rel\u003d\"stylesheet\" href\u003d\"//codeforces.org/s/96598/css/problem-statement.css\" type\u003d\"text/css\" /\u003e\u003cscript\u003e window.katexOptions \u003d { disable: true }; \u003c/script\u003e\n\u003cscript type\u003d\"text/x-mathjax-config\"\u003e\n MathJax.Hub.Config({\n tex2jax: {\n inlineMath: [[\u0027$$$\u0027,\u0027$$$\u0027], [\u0027$\u0027,\u0027$\u0027]],\n displayMath: [[\u0027$$$$$$\u0027,\u0027$$$$$$\u0027], [\u0027$$\u0027,\u0027$$\u0027]]\n }\n });\n\u003c/script\u003e\n\u003cscript type\u003d\"text/javascript\" async src\u003d\"https://mathjax.codeforces.org/MathJax.js?config\u003dTeX-AMS_HTML-full\"\u003e\u003c/script\u003e","sections":[{"title":"","value":{"format":"HTML","content":"\u003cp\u003eSasha likes programming. Once, during a very long contest, Sasha decided that he was a bit tired and needed to relax. So he did. But since Sasha isn\u0027t an ordinary guy, he prefers to relax unusually. During leisure time Sasha likes to upsolve unsolved problems because upsolving is very useful.\u003c/p\u003e\u003cp\u003eTherefore, Sasha decided to upsolve the following problem:\u003c/p\u003e\u003cp\u003eYou have an array $$$a$$$ with $$$n$$$ integers. You need to count the number of \u003cspan class\u003d\"tex-font-style-it\"\u003efunny\u003c/span\u003e pairs $$$(l, r)$$$ $$$(l \\leq r)$$$. To check if a pair $$$(l, r)$$$ is a \u003cspan class\u003d\"tex-font-style-it\"\u003efunny\u003c/span\u003e pair, take $$$mid \u003d \\frac{l + r - 1}{2}$$$, then if $$$r - l + 1$$$ is an \u003cspan class\u003d\"tex-font-style-bf\"\u003eeven\u003c/span\u003e number and $$$a_l \\oplus a_{l+1} \\oplus \\ldots \\oplus a_{mid} \u003d a_{mid + 1} \\oplus a_{mid + 2} \\oplus \\ldots \\oplus a_r$$$, then the pair is \u003cspan class\u003d\"tex-font-style-it\"\u003efunny\u003c/span\u003e. In other words, $$$\\oplus$$$ of elements of the left half of the subarray from $$$l$$$ to $$$r$$$ should be equal to $$$\\oplus$$$ of elements of the right half. Note that $$$\\oplus$$$ denotes the \u003ca href\u003d\"https://en.wikipedia.org/wiki/Bitwise_operation#XOR\"\u003ebitwise XOR operation\u003c/a\u003e.\u003c/p\u003e\u003cp\u003eIt is time to continue solving the contest, so Sasha asked you to solve this task.\u003c/p\u003e"}},{"title":"Input","value":{"format":"HTML","content":"\u003cp\u003eThe first line contains one integer $$$n$$$ ($$$2 \\le n \\le 3 \\cdot 10^5$$$)\u0026nbsp;— the size of the array.\u003c/p\u003e\u003cp\u003eThe second line contains $$$n$$$ integers $$$a_1, a_2, \\ldots, a_n$$$ ($$$0 \\le a_i \u0026lt; 2^{20}$$$)\u0026nbsp;— array itself.\u003c/p\u003e"}},{"title":"Output","value":{"format":"HTML","content":"\u003cp\u003ePrint one integer\u0026nbsp;— the number of \u003cspan class\u003d\"tex-font-style-it\"\u003efunny\u003c/span\u003e pairs. You should consider only pairs where $$$r - l + 1$$$ is even number.\u003c/p\u003e"}},{"title":"Examples","value":{"format":"HTML","content":"\u003ctable class\u003d\u0027vjudge_sample\u0027\u003e\n\u003cthead\u003e\n \u003ctr\u003e\n \u003cth\u003eInput\u003c/th\u003e\n \u003cth\u003eOutput\u003c/th\u003e\n \u003c/tr\u003e\n\u003c/thead\u003e\n\u003ctbody\u003e\n \u003ctr\u003e\n \u003ctd\u003e\u003cpre\u003e5\n1 2 3 4 5\n\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003e1\n\u003c/pre\u003e\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\n"}},{"title":"","value":{"format":"HTML","content":"\u003ctable class\u003d\u0027vjudge_sample\u0027\u003e\n\u003cthead\u003e\n \u003ctr\u003e\n \u003cth\u003eInput\u003c/th\u003e\n \u003cth\u003eOutput\u003c/th\u003e\n \u003c/tr\u003e\n\u003c/thead\u003e\n\u003ctbody\u003e\n \u003ctr\u003e\n \u003ctd\u003e\u003cpre\u003e6\n3 2 2 3 7 6\n\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003e3\n\u003c/pre\u003e\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\n"}},{"title":"","value":{"format":"HTML","content":"\u003ctable class\u003d\u0027vjudge_sample\u0027\u003e\n\u003cthead\u003e\n \u003ctr\u003e\n \u003cth\u003eInput\u003c/th\u003e\n \u003cth\u003eOutput\u003c/th\u003e\n \u003c/tr\u003e\n\u003c/thead\u003e\n\u003ctbody\u003e\n \u003ctr\u003e\n \u003ctd\u003e\u003cpre\u003e3\n42 4 2\n\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003e0\n\u003c/pre\u003e\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\n"}},{"title":"Note","value":{"format":"HTML","content":"\u003cp\u003e\u003cspan class\u003d\"tex-font-style-it\"\u003eBe as cool as Sasha, upsolve problems!\u003c/span\u003e\u003c/p\u003e\u003cp\u003eIn the first example, the only \u003cspan class\u003d\"tex-font-style-it\"\u003efunny\u003c/span\u003e pair is $$$(2, 5)$$$, as $$$2 \\oplus 3 \u003d 4 \\oplus 5 \u003d 1$$$.\u003c/p\u003e\u003cp\u003eIn the second example, funny pairs are $$$(2, 3)$$$, $$$(1, 4)$$$, and $$$(3, 6)$$$.\u003c/p\u003e\u003cp\u003eIn the third example, there are no \u003cspan class\u003d\"tex-font-style-it\"\u003efunny\u003c/span\u003e pairs.\u003c/p\u003e"}}]}