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 sp = 0
    let d = A[sp]
    let xor = A[sp]
    let m = 1
    let count = 0
    while (sp < N) {
        m = Math.max(m, sp)
        for (let i = m; i <= N; i++) {
            if (d === xor) {
                count++
                d = d + A[i]
                xor = xor ^ A[i]
                m++
            } else {
                break
            }
        }
        ans += count
        xor = xor ^ A[sp]
        d = d - A[sp]
        sp++
        count--
    }
 
    console.log(ans)

})(input)
