#include <stdio.h>
#include <inttypes.h>

int main(void) {
	int n;
	while (scanf("%d", &n) == 1 && n > 0) {
		int i;
		int64_t a[12345];
		int64_t sum = 0;
		int count = 0;
		for (i = 0; i < n; i++) {
			if (scanf("%" SCNd64, &a[i]) != 1) return 1;
			sum += a[i];
		}
		for (i = 0; i < n; i++) {
			if (a[i] * n <= sum) count++;
		}
		printf("%d\n", count);
	}
	return 0;
}

