'use strict'

function main(input) {
    input = input.split("\n");
    const N = parseInt(input[0]);
    const A = input[1].split(' ').map(str => parseInt(str));
    let ans = N;
    // n は組の個数
    for (let n = 2; n <= N; n+=2) {
        let xor = 0;
        let sum = 0;
        for (let i = 0; i < n; i++) {
            xor ^= A[i];
            sum += A[i];
        }
        if (xor === sum)
            ans++;
        for (let i = 0; i < N - n; i++) {
            xor ^= A[i+n];
            sum += A[i+n];
            if (xor === sum)
                ans++;
            xor ^= A[i];
            sum -= A[i];
            if (xor === sum)
                ans++;
        }
    }
    console.log(ans);
}

main(require('fs').readFileSync('/dev/stdin', 'utf-8'));
