import java.io.File;
import java.io.PrintWriter;
import java.util.*;

public class hack_gk_int {
    public static final int BITS = 31;
    static Scanner in;
    static PrintWriter out;
    private final Map<Integer, List<Integer>> xors = new HashMap<>();

    void run() {
        int n = in.nextInt();

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

        n++;
        int cum = 0;
        for (int i = 0; i < n; i++) {
            cum ^= a[i];
            List<Integer> indices = xors.get(cum);
            if (indices == null) {
                indices = new ArrayList<>();
                xors.put(cum, indices);
            }
            indices.add(i);
        }

        int[][] next = new int[n][BITS];
        for (int i = 0; i < n; i++) {
            for (int b = 0; b < BITS; b++) {
                next[i][b] = -1;
                int p = i * BITS + b;
                if ((a[i] & (1 << b)) == 0) {
                    for (int j = i; j >= 0 && next[j][b] == -1; j--) {
                        next[j][b] = p;
                    }
                }
            }
        }

        long c = 0;
        cum = 0;
        for (int i = 0; i < n - 1; i++) {
            Arrays.sort(next[i]);

            int and = (1 << BITS) - 1;
            int l = i;
            for (int pair : next[i]) {
                int f = pair / BITS;
                int b = pair % BITS;
                if (l != f) {
                    c += query(cum ^ and, l, f);
                }
                l = f;
                and ^= (1 << b);
            }
            c += query(cum ^ and, l, (n - 1));
            cum ^= a[i];
        }
        out.println(c);
    }

    private long query(int xor, int l, int r) {
        List<Integer> indices = xors.get(xor);
        if (indices == null) {
            return 0;
        }
        int lb = Collections.binarySearch(indices, l);
        if (lb < 0) {
            lb = -lb - 1;
        }
        int rb = Collections.binarySearch(indices, r);
        if (rb < 0) {
            rb = -rb - 1;
        }
        return rb - lb;
    }


    public static void main(String[] args) throws Exception {
        in = new Scanner(new File("hack.in"));
        out = new PrintWriter("hack.out");

        new hack_gk_int().run();

        in.close();
        out.close();
    }
}
