function Main(input) {
  const array = input.trim().split('\n')
  const N = parseInt(array[0])
  const A = array[1].split(' ').map(s => parseInt(s))

  var res = 0
  var right = 0
  var sum = 0

  for(var left = 0; left < N; ++left) {
    while(right < N && (sum ^ A[right]) === (sum + A[right])) {
      sum += A[right]
      ++right
    }

    res += right - left
        
    // しゃくとり法
    if (left === right) ++right
    else sum -= A[left]  // a[left] を削除 (sum ^= a[left] でも OK)
  }

  console.log(res)
  
}
Main(require("fs").readFileSync("/dev/stdin", "utf8"));