#include <iostream>
#include <sstream>
#include <String>


int main() {

	int n;
	int a[200000];
	std::cin >> n;;

	int i,j;
	for (i = 0; i < n; i++) {
		std::cin >> a[i];
	}

	int start = 0;
	int length = 2;
	int count = 0;
	int sum=0;

	while (length <= n) {

		for (start = 0; start <= n - length; start++) {

			for (i = 0; i < length;i++) {
				sum = sum + a[start + i];
			}
			if (sum == 0) {
				count++;
			}
		}
		length++;
		sum = 0;

	}
	std::cout << sum << std::endl;
	return 0;
}