#include<string>
using namespace std;
#include <stdio.h>
#include <limits.h>
#include "bits/stdc++.h"
int xx, a[200010], N, ans1,sum;
int main()
{
	cin >> N;
	for (int x = 1; x++; x < N) {
		cin >> xx;
		a[i] = xx;
	}
	for (int y = 1; y++; y < N) {
		sum = 0 + a[y];
		for (int z=y+1;z++;z<N-y+1)
			sum = sum + a[z];
		if (sum == 0) {
			ans1++;
		}
	}
	cout << ans1;
	return 0;

}
