#include <bits/stdc++.h>
using namespace std;
int main() {
  int N;
  cin >> N;
  int a[N + 10];
  int res = 0;
  for (int i = 0; i < N; ++i) cin >> a[i];
  for (int all = 1; all < (1 << N); all++) {
    int sum = 0;
    for (int i = 0; i < N; ++i) {
      if (all & (1 << i)) {
        sum += a[i];
      }
    }
    if (sum == 0) {
      if (all) {
        res++;
      }
    }
    cout << res << endl;
  }
}
