#include <stdio.h>

int main(void){
	int n, count, a[10001];
	double ave;

	while(1){
		scanf("%d", &n);
		if(!n) break;

		ave = 0.0;
		for(int i=0; i<n; i++){
			scanf("%d", &a[i]);
			ave += a[i];
		}

		ave /= n;
		count = 0;
		for(int i=0; i<n; i++){
			if(ave >= a[i]) count++;
		}
		printf("%d\n", count);
	}//endwhile

	return 0;
}
