#include <bits/stdc++.h>
using namespace std;
int A[200000];
int minians;
int n;
int i = 0, j = 0;
int saiki(int sum, int i) {
  if (i == n) return false;
  if (sum + A[i] == 0) {
    minians++;
    saiki(sum + A[i], i + 1);
  }
  if (sum + A[i] != 0) {
    saiki(sum + A[i], i + 1);
  }
}
int main() {
  cin >> n;
  for (i = 0; i <= n - 1; i++) cin >> A[i];
  for (j = 0; j <= n - 1; j++) saiki(0, j);
  cout << minians << endl;
}
