#include <bits/stdc++.h>
using namespace std;
int main() {
  int answer = 0;
  int N;
  cin >> N;
  vector<int> plus;
  vector<int> minux;
  for (int i = 0; i < N; i++) {
    int tmp;
    cin >> tmp;
    if (tmp >= 0) {
      plus.push_back(tmp);
    } else {
      minux.push_back(tmp);
    }
  }
  vector<int> p(plus);
  vector<int> m(minux);
  for (int i = 0; i < (1 << minux.size()); i++) {
    int msum = 0;
    if (__builtin_popcount(i) > 1) {
      for (int j = 0; j < minux.size(); j++) {
        if (i >> j & 1) msum += minux[j];
      }
      m.push_back(msum);
    }
  }
  for (int i = 0; i < (1 << plus.size()); i++) {
    int msum = 0;
    if (__builtin_popcount(i) > 1) {
      for (int j = 0; j < plus.size(); j++) {
        if (i >> j & 1) msum += plus[j];
      }
      p.push_back(msum);
    }
  }
  for (auto iter1 = m.begin(); iter1 != m.end(); iter1++) {
    for (auto iter2 = p.begin(); iter2 != p.end(); iter2++) {
      if (*iter1 + *iter2 == 0) {
        answer++;
      }
      cout << *iter1 << *iter2 << endl;
    }
  }
  cout << answer << endl;
  return 0;
}
