#include <iostream>
#include <algorithm>
#include <vector>
#include <list>

#define LL long long

using namespace std;

int main()
{
	while (1) {
		int n; cin >> n;
		if (n == 0) { break; }
		vector <int> vec(n);
		int sum = 0, ans = 0;
		for (int i = 0; i < n; i++) {
			int j; cin >> j;
			vec[i] = j;
			sum += j;
		}
		double avr = sum / n;
		for (int i = 0; i < n; i++) {
			if (vec[i] <= avr) { ans++; }
		}
		cout << ans << endl;
	}
	return 0;
}
