import java.io.*;
import java.util.*;
 
public class hack_mk {
    private static void solve() throws IOException {
        int n = nextInt();
        int[] a = new int[n];
        for (int i = 0; i < n; i++) {
            a[i] = nextInt();
        }
        long answer = solve(a);
 
        out.println(answer);
    }
 
    private static long solve(int[] a) {
        int n = a.length;
        int bits = 31;
        int[] lastZero = new int[bits];
 
        Map<Integer, Integer> countForXor = new HashMap<Integer, Integer>();
        long answer = 0;
 
        int[] wasXor = new int[n + 1];
 
        countForXor.put((1 << bits) - 1, 1);
        Arrays.fill(lastZero, 0);
        wasXor[0] = (1 << bits) - 1;
 
        int currentXor = 0;
 
        for (int pos = 1; pos <= n; pos++) {
            int value = a[pos - 1];
            for (int bit = 0; bit < bits; bit++) {
                int curBit = (value >> bit) & 1;
                if (curBit == 0) {
                    for (int i = lastZero[bit]; i < pos; i++) {
                        int thing = wasXor[i];
                        add(countForXor, thing, -1);
                        thing ^= 1 << bit;
                        add(countForXor, thing, 1);
                        wasXor[i] = thing;
                    }
                    lastZero[bit] = pos;
                }
            }
 
            Integer ok = countForXor.get(currentXor ^ value);
 
            if (ok != null) {
                answer += ok;
            }
 
            wasXor[pos] = currentXor ^ ((1 << bits) - 1) ^ value;
            add(countForXor, wasXor[pos], 1);
            currentXor ^= value;
        }
        return answer;
    }
 
    private static void add(Map<Integer, Integer> countForXor, Integer thing,
            int add) {
        Integer have = countForXor.get(thing);
        if (have == null) {
            have = 0;
        }
        have += add;
        if (have == 0) {
            countForXor.remove(thing);
        } else {
            countForXor.put(thing, have);
        }
    }
 
    public static void main(String[] args) throws IOException {
        br = new BufferedReader(new FileReader("hack.in"));
        out = new PrintWriter("hack.out");
        solve();
        out.close();
    }
 
    static BufferedReader br;
    static PrintWriter out;
    static StringTokenizer st;
 
    static String nextToken() throws IOException {
        while (st == null || !st.hasMoreTokens()) {
            String line = br.readLine();
            if (line == null) {
                return null;
            }
            st = new StringTokenizer(line);
        }
        return st.nextToken();
    }
 
    static int nextInt() throws IOException {
        return Integer.parseInt(nextToken());
    }
 
    static long nextLong() throws IOException {
        return Long.parseLong(nextToken());
    }
}