Collection of Postage Stamps#include <iostream>
#include <bitset>
using namespace std;
bitset<1000001> b;
int main()
{ int i,k,v;
cin>>k;
b.reset();
b.set(0);
for(i=0;i<k;i++)
{ cin>>v;
b|=b<<v;
}
cout<<b.count()<<endl;
return 0;
}