#include <stdio.h>
#define ll long long
#define rep(i,l,r)for(ll i=l;i<r;i++)

ll a[10010];
int main(){
	ll n;
	while(scanf("%lld",&n),n){
		ll s=0;
		rep(i,0,n){
			scanf("%lld",a+i);
			s+=a[i];
		}
		ll ans=0;
		rep(i,0,n)if(a[i]*n<=s)ans++;
		printf("%lld\n",ans);
	}
}
