#include <iostream>
using namespace std;

const int N = 25;
int a[N];
int f[N];//f[i][j]代表从前i个物品中选有几种方
int main() {
    int n;
    cin >> n;
    for (int i = 1; i <= n; i++) {
        cin >> a[i];
    }
    // f[0]=
    f[0] = 1;
    int m = 40;
    for (int i = 1; i <= n; i++)
        for (int j = m; j >= a[i]; j--)
        {
            f[j] += f[j - a[i]];
        }
    cout << f[40];
}
// 64 位输出请用 printf("%lld")