#include <stdio.h>
int main(){
  while(1==1){
   int n =0;
   int count =0;
   scanf("%d",&n);
   if(n == 0){break;}
   int sum = 0;
   int m[100004] = {0};
   for(int i = 0;i < n;i++){
     scanf("%d",&m[i]);
     sum = sum + m[i];
   }
   for(int j = 0; j < n;j++){
     if(n*m[j] <= sum){
       count++;
     }
   }
   printf("%d\n",count);
  }
return 0;
}

