import java.util.Scanner

object Main {
  def solve(N: Int, A: Array[Int]): Long = {
    var s = 0
    var t = 0
    var res: Long = 0
    var sum: Long = A(0)
    var xor: Long = A(0)

    while(s < N) {
      while(t < N && sum == xor) {
        t += 1
        if (t < N) {
          sum += A(t)
          xor ^= A(t)
        }
      }
      res += t - s
      sum -= A(s)
      xor ^= A(s)
      s += 1
    }
    res
  }

  def main(args: Array[String]): Unit = {
    val sc = new Scanner(System.in)
    val N = sc.nextInt()
    val A = Array.fill(N)(sc.nextInt())
    println(solve(N, A))
  }
}
