#include <bits/stdc++.h>
#define N (200010)

int n;
int a[N];
int b[N]; /* a - 数值之和, b - 数值亦或和*/

int main()
{
    std::ios::sync_with_stdio(0);
    std::cin >> n;
    for (int i = 1; i <= n; i++)
    {
        int x;
        std::cin >> x;
        a[i] = a[i - 1] + x, b[i] = b[i - 1] ^ x;
    }
    int l = 1;
    long long sum = 0;
    for (int i = 1; i <= n; i++)
    {
        while (a[i] - a[l - 1] != (b[i] ^ b[l - 1])) /* 尺取法 */
            l++;
        sum += i - l + 1; /* 总数累加 */
    }
    std::cout << sum << std::endl;
    return 0;
}