const input = require("fs").readFileSync("/dev/stdin", "utf8")

;(input => {
    const lines = input.split('\n')
    const N = lines[0] - 0
    const A = lines[1].split(' ').map(Number)

    let ans = 0
    let head = 0
    let sum = 0
    let xor = 0
    for (let i = 0 ; i < N; i++) {
        for (let j = head; j < N; j++) {
            sum = sum + A[j]
            xor = xor ^ A[j]
            if (sum === xor) {
                head++
            } else {
                xor = xor ^ A[j]
                sum = sum - A[j]
                break
            }
        }
        ans += head - i
        xor = xor ^ A[i]
        sum = sum - A[i]
    }

    console.log(ans)

})(input)
