#include<iostream>
#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<cmath>
#include<string>
#include<algorithm>
#include<vector>
#include<queue>
#include<set>
#include<map>
#include<stack>

#define MOD 10000000
using namespace std; 
typedef long long LL;

long long quickpow(long long n, long long base) {
    long long res = 1;
    while(n) {
        if(n & 1) {
            res = res * base % MOD;
        }
        n >>= 1;
        base = base * base % MOD;
    }
    return res;
}//¿ìËÙÃÝ 
float A[10050];
int main()
{
	int n;
	int flag=1;
	cin>>n;
	 while(n)
	 {
	 	float sum=0;
 		for(int i=1;i<=n;i++)
 		{
		  cin>>A[i];
 		  sum+=A[i];
 		}
 		int ans=0;
 		float ave=sum/n;
 		for(int i=1;i<=n;i++)
 		{
		 	if(A[i]<=ave)
		 	ans++;
	    }
	    cout<<ans<<endl;
 		cin>>n;
 	}
} 











