unittest
{
	assert( [ "4", "2 5 4 6" ].solve == 5 );
	assert( [ "9", "0 0 0 0 0 0 0 0 0" ].solve == 45 );
	assert( [ "19", "885 8 1 128 83 32 256 206 639 16 4 128 689 32 8 64 885 969 1" ].solve == 37 );
}



import std.conv;
import std.range;
import std.stdio;

void main()
{
	stdin.byLineCopy.solve.writeln;
}

auto solve( Range )( Range input )
if( isInputRange!Range && is( ElementType!Range == string ) )
{
	auto n = input.front.to!( long );
	input.popFront;
	auto as = input.front.split.to!( long[] );
	
	auto ans = 0L;
	for( auto l = 0L, r = 0L, t = 0L; l < as.length; l++ )
	{
		for( ; r < as.length && ( t ^ as[ r ] ) == t + as[ r ]; r++ )
		{
			t ^= as[ r ];
		}
		t ^= as[ l ];
		ans += r - l;
	}
	return ans;
}
