#include <bits/stdc++.h>

using namespace std;

const int N = 50;
int f[N][N]; // 从前i个物品中选,总体积是j的方案数 
int a[N];
 
int main(){
	
	int n;
	int V = 40;
	cin >> n;
	
	for (int i=1; i<=n; i++){
		cin >> a[i];
	}
	
	f[0][0] = 1;

	for (int i=1; i<=n; i++){
		for (int j=0; j<=V; j++){
			if (a[i] > j){
				f[i][j] = f[i-1][j];
			}
			else{
				f[i][j] = f[i-1][j] + f[i-1][j-a[i]];
			}
		}
	} 
	
	cout << f[n][V];
	
	return 0;
}