#include <bits/stdc++.h>

using namespace std;
#define REP(i,n) for(int i=0;i<(n);i++)

vector<int>a[50505];
int N[50505];
double ave[50505];
int main() {
	int cnt = 0;
	REP(i, 100010) {
		cin >> N[i];
		if (N[i] == 0)break;
		cnt++;
		ave[i] = 0;
		REP(j, N[i]) {
			int x; cin >> x;
			a[i].push_back(x);
			ave[i] += x;
		}
	}
	//cout << cnt << endl;
	REP(i, cnt) {
		ave[i] /= N[i];
		int ans = 0;
		REP(j, N[i]) {
			if (a[i][j] <= ave[i]) {
				ans++;
			}
		}
		cout << ans << endl;
	}
}
