import java.io.*;
import java.util.*;

public class hack_va_n2 implements Runnable {
	public static void main(String[] args) {
		new Thread(new hack_va_n2()).run();
	}

	BufferedReader br;
	StringTokenizer in;
	PrintWriter out;

	public String nextToken() throws IOException {
		while (in == null || !in.hasMoreTokens()) {
			in = new StringTokenizer(br.readLine());
		}

		return in.nextToken();
	}

	public int nextInt() throws IOException {
		return Integer.parseInt(nextToken());
	}

	public long nextLong() throws IOException {
		return Long.parseLong(nextToken());
	}

	public double nextDouble() throws IOException {
		return Double.parseDouble(nextToken());
	}

	public void solve() throws IOException {
		int n = nextInt();

		int[] a = new int[n];
		for (int i = 0; i < a.length; i++) {
			a[i] = nextInt();
		}

		int ans = 0;
		for (int i = 0; i < a.length; i++) {
			int xor = 0;
			int and = a[i];
			for (int j = i; j < a.length; j++) {
				xor ^= a[j];
				and &= a[j];
				if (xor == and)
					ans++;
			}
		}
		out.println(ans);
	}

	public void run() {
		try {
			br = new BufferedReader(new FileReader("hack.in"));
			out = new PrintWriter("hack.out");

			solve();

			out.close();
		} catch (IOException e) {
			e.printStackTrace();
			System.exit(1);
		}
	}
}
