import java.util.Map;
import java.io.InputStreamReader;
import java.io.IOException;
import java.util.Arrays;
import java.util.HashMap;
import java.io.BufferedReader;
import java.io.OutputStream;
import java.io.FileOutputStream;
import java.io.PrintWriter;
import java.io.FileInputStream;
import java.util.StringTokenizer;
import java.io.InputStream;
 
/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 */
public class hack_petr {
    public static void main(String[] args) {
        InputStream inputStream;
        try {
            inputStream = new FileInputStream("hack.in");
        } catch (IOException e) {
            throw new RuntimeException(e);
        }
        OutputStream outputStream;
        try {
            outputStream = new FileOutputStream("hack.out");
        } catch (IOException e) {
            throw new RuntimeException(e);
        }
        InputReader_petr in = new InputReader_petr(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        Hack_petr_0 solver = new Hack_petr_0();
        solver.solve(1, in, out);
        out.close();
    }
}
 
class Hack_petr_0 {
    static final int BITS = 31;
 
    public void solve(int testNumber, InputReader_petr in, PrintWriter out) {
        int n = in.nextInt();
        int[] a = new int[n];
        for (int i = 0; i < n; ++i) {
            a[i] = in.nextInt();
        }
        int[] lastzero = new int[BITS];
        Arrays.fill(lastzero, -1);
        int[] pxor = new int[n + 1];
        pxor[0] = (1 << BITS) - 1;
        int axor = 0;
        long res = 0;
        Map<Integer, Integer> counts = new HashMap<Integer, Integer>();
        counts.put(pxor[0], 1);
        for (int i = 0; i < n; ++i) {
            axor ^= a[i];
            for (int bit = 0; bit < BITS; ++bit)
                if ((a[i] & (1 << bit)) == 0) {
                    for (int pos = lastzero[bit] + 1; pos <= i; ++pos) {
                        int old = counts.get(pxor[pos]);
                        if (old == 1)
                            counts.remove(pxor[pos]);
                        else
                            counts.put(pxor[pos], old - 1);
                        pxor[pos] ^= (1 << bit);
                        Integer mold = counts.get(pxor[pos]);
                        if (mold == null)
                            counts.put(pxor[pos], 1);
                        else
                            counts.put(pxor[pos], mold + 1);
                    }
                    lastzero[bit] = i;
                }
            Integer seen = counts.get(axor);
            if (seen != null) res += seen;
            {
                pxor[i + 1] = axor ^ ((1 << BITS) - 1);
                int pos = i + 1;
                Integer mold = counts.get(pxor[pos]);
                if (mold == null)
                    counts.put(pxor[pos], 1);
                else
                    counts.put(pxor[pos], mold + 1);
            }
        }
        out.println(res);
    }
}
 
class InputReader_petr {
    public BufferedReader reader;
    public StringTokenizer tokenizer;
 
    public InputReader_petr(InputStream stream) {
        reader = new BufferedReader(new InputStreamReader(stream));
        tokenizer = null;
    }
 
    public String next() {
        while (tokenizer == null || !tokenizer.hasMoreTokens()) {
            try {
                tokenizer = new StringTokenizer(reader.readLine());
            } catch (IOException e) {
                throw new RuntimeException(e);
            }
        }
        return tokenizer.nextToken();
    }
 
    public int nextInt() {
        return Integer.parseInt(next());
    }
 
    }