#include<bits/stdc++.h>
using namespace std;
const int N = 100005;
int n,a[N],ans,tmp;
int main() {
	scanf("%d",&n);
	for(int i = 1; i <= n; i++) scanf("%d",&a[i]);
	for(int i = 1; i < n; i++) {
		tmp = a[i];
		for(int j = i + 1; j <= n; j++)
			if((tmp ^ a[j]) == (tmp + a[j])) {
				ans++;
				tmp += a[j];
			} else break;
	}
	printf("%d\n",ans+n);
	return 0;
}