open Batteries

let main () =
  let n = Scanf.scanf "%d\n" (fun x -> x) in
  let a = Array.make n 0 in
  for i = 0 to n - 2 do
    a.(i) <- Scanf.scanf "%d " (fun x -> x)
  done;
  a.(n-1) <- Scanf.scanf "%d\n" (fun x -> x);
  let ans = ref 0 in
  let acc1 = ref 0 in
  let acc2 = ref 0 in
  for i = 0 to n - 2 do
    for j = i + 1 to n - 1 do
      acc1 := 0;
      acc2 := 0;
      for k = i to j do
        acc1 := !acc1 lxor a.(k);
        acc2 := !acc2 + a.(k);
      done;
      if !acc1 = !acc2 then ans := !ans + 1;
    done;
  done;
  Printf.printf "%d\n" (!ans + n)

let _ = main ()
