#include <cstdio>
#include <algorithm>

#define ll long long
#define inf 0x3f3f3f3f
#define il inline

namespace io {

    #define in(a) a=read()
    #define out(a) write(a)
    #define outn(a) out(a),putchar('\n')

    #define I_int int
    inline I_int read() {
        I_int x = 0 , f = 1 ; char c = getchar() ;
        while( c < '0' || c > '9' ) { if( c == '-' ) f = -1 ; c = getchar() ; }
        while( c >= '0' && c <= '9' ) { x = x * 10 + c - '0' ; c = getchar() ; }
        return x * f ;
    }
    char F[ 200 ] ;
    inline void write( I_int x ) {
        if( x == 0 ) { putchar( '0' ) ; return ; }
        I_int tmp = x > 0 ? x : -x ;
        if( x < 0 ) putchar( '-' ) ;
        int cnt = 0 ;
        while( tmp > 0 ) {
            F[ cnt ++ ] = tmp % 10 + '0' ;
            tmp /= 10 ;
        }
        while( cnt > 0 ) putchar( F[ -- cnt ] ) ;
    }
    #undef I_int

}
using namespace io ;

#define N 100010

int n;
int a[N] , ans = 0;

int main() {
	n = read() ;
	for(int i = 1; i <= n; i ++) a[i] = read() ;
	for(int l = 1 , r = 0 , now = 0; l <= n; ) {
		while((now ^ a[r + 1]) == (now + a[r + 1]) && r < n) {
			now ^= a[++ r] ;
		}
		ans += r - l + 1;
		now ^= a[l ++] ;
	}
	outn(ans) ;
	return 0 ;
}