program test
implicit none
integer :: i,j,k,m,n,c
integer :: a(200000),ruiseki(0:200000)=0,ruiseki_xor(0:200000)=0,ans=0,a1,a2

read(*,*) n
read(*,*) (a(i),i=1,n)

do i=1,n
	ruiseki(i) = ruiseki(i-1) + a(i)
	ruiseki_xor(i) = ixor(ruiseki_xor(i-1),a(i))
enddo

!尺取りっぽい
i = 1
j = 1

do
	a1 = ruiseki(j) - ruiseki(i-1)
	a2 = ixor(ruiseki_xor(j),ruiseki_xor(i-1))
	if(a1 == a2) then
		ans = ans + (j-i+1)
		if(j == n) then
			goto 10
		endif
		j = j + 1
	else
		i = i + 1
	endif
enddo

10 continue

write(*,*) ans

end program