import java.io.*;
import java.util.*;
 
public class hack_nn {
 
    static void solve() throws IOException {
        int n = nextInt();
        int[] a = new int[n];
        for (int i = 0; i < n; i++) {
            a[i] = nextInt();
        }
        int[] xors = a.clone();
        for (int i = 1; i < n; i++) {
            xors[i] ^= xors[i - 1];
        }
        int bits = 31;
        int[][] prev = new int[bits][n];
        for (int i = 0; i < n; i++) {
            for (int j = 0; j < bits; j++) {
                if (i > 0) {
                    prev[j][i] = prev[j][i - 1];
                } else {
                    prev[j][i] = -1;
                }
            }
            for (int j = 0; j < bits; j++) {
                if (((a[i] >> j) & 1) == 0) {
                    prev[j][i] = i;
                }
            }
        }
        int[] allXors = new int[xors.length + 1];
        for (int i = 0; i < xors.length; i++) {
            allXors[i] = xors[i];
        }
        Arrays.sort(allXors);
        {
            int j = 1;
            for (int i = 1; i < allXors.length; i++) {
                if (allXors[j - 1] != allXors[i]) {
                    allXors[j++] = allXors[i];
                }
            }
            allXors = Arrays.copyOf(allXors, j);
        }
        List<Integer>[] xs = new ArrayList[allXors.length];
        for (int i = 0; i < allXors.length; i++) {
            xs[i] = new ArrayList<>();
        }
        xs[Arrays.binarySearch(allXors, 0)].add(-1);
        for (int i = 0; i < xors.length; i++) {
            xs[Arrays.binarySearch(allXors, xors[i])].add(i);
        }
        long ans = 0;
        for (int i = 0; i < n; i++) {
            final int[] events = new int[bits];
            Integer[] id = new Integer[bits];
            for (int j = 0; j < bits; j++) {
                events[j] = prev[j][i];
                id[j] = j;
            }
            Arrays.sort(id, new Comparator<Integer>() {
                @Override
                public int compare(Integer o1, Integer o2) {
                    return Integer.compare(events[o1], events[o2]);
                }
            });
            int last = i;
            int mask = Integer.MAX_VALUE;
            for (int j = bits - 1; j >= 0; mask &= ~(1 << id[j]), j--) {
                int f = id[j];
                if (events[f] == last) {
                    continue;
                }
                int need = xors[i] ^ mask;
                ans += getCount(need, events[f], last, allXors, xs);
                last = events[f];
            }
            ans += getCount(xors[i], -1, last, allXors, xs);
        }
        out.println(ans);
    }
 
    static int getCount(int need, int left, int right, int[] allXors,
            List<Integer>[] xs) {
        // System.err.println(need + " " + left + " " + right);
        int id = Arrays.binarySearch(allXors, need);
        if (id < 0) {
            return 0;
        }
        int l = -1;
        int r = xs[id].size();
        List<Integer> list = xs[id];
        while (l < r - 1) {
            int mid = l + r >> 1;
            if (list.get(mid) < left) {
                l = mid;
            } else {
                r = mid;
            }
        }
        int ansL = r;
        l = -1;
        r = xs[id].size();
        while (l < r - 1) {
            int mid = l + r >> 1;
            if (list.get(mid) >= right) {
                r = mid;
            } else {
                l = mid;
            }
        }
        int ansR = l;
        // System.err.println(need + " " + left + " " + right + " " + ansL + " "
        // + ansR);
        if (ansR < ansL)
            return 0;
        return ansR - ansL + 1;
    }
 
    public static void main(String[] args) throws Exception {
        File file = new File("hack.in");
        InputStream input = System.in;
        PrintStream output = System.out;
        if (file.exists() && file.canRead()) {
            input = new FileInputStream(file);
            output = new PrintStream("hack.out");
        }
        br = new BufferedReader(new InputStreamReader(input));
        out = new PrintWriter(output);
        solve();
        out.close();
    }
 
    static BufferedReader br;
    static StringTokenizer st;
    static PrintWriter out;
 
    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());
    }
 
    static double nextDouble() throws IOException {
        return Double.parseDouble(nextToken());
    }
}