include[HTML_REMOVED]
using namespace std;
const int N = 110,M=100010,B = M/2;
bool f[N][M];//选择前i个物品,体重为j
int w[N];
int n,m;
int main()
{
cin>>n;
for(int i =1;i<=n;i)
{
cin>>w[i];
m+=w[i];
}
f[0][B]=true;//因为数组的下标不能为0
for(int i = 1;i<=n;i)
for(int j = -m;j<=m;j++ )//砝码重量
{
f[i][j+B]=f[i-1][j+B];//没选第i个物品
if(j-w[i]>=-m)//选择加第i个物品
f[i][j+B] |= f[i-1][j-w[i]+B];
if(j+w[i]<=m)//选择减第i个砝码
f[i][j+B] |= f[i-1][j+w[i]+B];
}
int res = 0;
for(int j=1;j<=m;j++)
{
if(f[n][j+B])
res++;
}
cout<<res;
return 0 ;
}