#include <bits/stdc++.h>
using namespace std;
void func(vector<int> hoge, vector<int> &save, int sum) {
  if (hoge.size() > 0) {
    int tmp = hoge[0];
    hoge.erase(hoge.begin());
    for (int i = 0; i < 2; i++) {
      if (i == 0) {
        sum += tmp;
        func(hoge, save, sum);
        sum -= tmp;
      } else {
        func(hoge, save, sum);
      }
    }
  } else {
    if (sum != 0) {
      save.push_back(sum);
    }
  }
}
int main(void) {
  int n;
  vector<int> a;
  vector<int> plus;
  vector<int> minus;
  vector<int> psum;
  vector<int> msum;
  cin >> n;
  for (int i = 0; i < n; i++) {
    int hoge;
    cin >> hoge;
    a.push_back(hoge);
  }
  for (int i = 0; i < n; i++) {
    if (a[i] > 0) {
      plus.push_back(a[i]);
    }
    if (a[i] < 0) {
      minus.push_back(a[i]);
    }
  }
  func(plus, psum, 0);
  func(minus, msum, 0);
  int count = 0;
  for (int i = 0; i < psum.size(); i++) {
    for (int j = 0; j < msum.size(); j++) {
      if (psum[i] == msum[j]) {
        count++;
      }
    }
  }
  cout << count << endl;
  return 0;
}
