import std.stdio, std.string, std.range, std.conv, std.array, std.algorithm, std.math, std.typecons;

void main() {
    const N = readln.chomp.to!long;
    const as = readln.split.to!(long[]);

    long cnt;
    long ss, xs;
    long r;
    foreach (l; 0..N) {
        while (r < N && ss + as[r] == (xs ^ as[r])) {
            ss += as[r];
            xs ^= as[r];
            r++;
        }
        cnt += r-l;
        ss -= as[l];
        xs ^= as[l];
    }
    writeln(cnt);
}

