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