#include<iostream>
using namespace std;

int main()
{
    int n;

    while( cin >> n )
    {
        if( n == 0 )
            break;
        int a[n];

        double sum = 0;
        for( int i = 0; i < n; i++ )
        {
            cin >> a[i];
            sum += a[i];
        }

        double ave = sum / n;
        int cnt = 0;
        for( int i = 0; i < n; i++ )
            if( a[i] <= ave )
                cnt++;

        cout << cnt << endl;
    }
    return 0;
}
