//#include<bits/stdc++.h>
#include<iostream>
#include<stdio.h>
#include<conio.h>
#define pi 3.141592653897932384626
#define abs(x) ((x)>0?(x):(-(x)))
#define eps (double)(0.0000001)
#define fs first
#define se second
//freopen("in.txt","r",stdin);freopen("out.txt","w",stdout);
using namespace std;
long a[1000];
int main()
{
    long n;
    cin>>n;
    while(n){
        long s=0,x=0;
        for(long i=0;i<n;++i){scanf("%ld",&a[i]);s+=a[i];}
        s/=n;
        for(long i=0;i<n;++i){if(a[i]<=s)++x;}
        cout<<x<<endl;
        cin>>n;
    }
    return 0;
}

