#include <iostream>
#include <cstring>
#include <algorithm>
#include <bitset>
using namespace std;
const int N = 105, M = 100005;
int g[N], n;
bitset<M> S;
int main()
{
scanf("%d", &n);
for (int i = 0; i < n; i ++ ) {
scanf("%d", &g[i]);
}
S[0] = 1;
for (int i = 0; i < n; i ++ ) {
S |= S << g[i];
}
for (int i = 0; i < n; i ++ ) {
S |= S >> g[i];
}
cout << S.count() - 1 << endl;
return 0 ;
}