import java.util.Scanner;

object Main{
  def main(args: Array[String]){
    val sc = new Scanner(System.in);
    val n = sc.nextInt;
    val as = List.fill(n)(sc.nextInt);

    val sumAdd = as.scanLeft(0)((a,b) => a+b).toArray;
    val sumXor = as.scanLeft(0)((a,b) => a^b).toArray;

    var count = 0;
    var end = 1;

    for(i <- 1 to n){
      val temp = (for(j <- end to n) yield (sumAdd(j) - sumAdd(i-1), sumXor(j) ^ sumXor(i-1))).takeWhile(x => x._1 == x._2);
      end += temp.length;
      count += end-i;
    }
    println(count);
  }
}
