import java.util.Scanner

object Main {
  def main(args: Array[String]): Unit = println(solve(new Scanner(System.in)))

  def solve(in: String): String = {
    println("-" * 80)
    val start = System.currentTimeMillis
    val result = solve(new Scanner(in))
    val end = System.currentTimeMillis
    println("%d ms.".format(end - start))
    result
  }

  def solve(sc: Scanner): String = {
    val N = sc.nextInt
    val A = Array.fill(N)(sc.nextInt)

    var ans = 0L
    var sum = 0
    var r = 0
    for (l <- 0 until N) {
      if (r <= l) {
        r = l
        sum = 0
      }
      ans += r - l
      while (r < N && sum + A(r) == (sum ^ A(r))) {
        sum += A(r)
        r += 1
        ans += 1
      }
      sum -= A(l)
    }
    ans.toString
  }
}
