x[200010],c,i;main(j){for(scanf("%d",&c);~scanf("%d",&j);*x=1)for(i=0;ix[i]?x[i+j]=x[i]+1:0;i=!printf("%d",x[c]-1);}