//12/11アルゴリズム
#include<iostream>
using namespace std;

int main(){
  while(true){
    int n;
    cin>>n;

    if(n==0)break;

    int a[n];
    int sum=0;
    for(int i=0;i<n;i++){
      cin>>a[i];
      sum += a[i];
    }

    int avarage=sum/n;
    int poor=0;

    for(int i=0;i<n;i++){
      if(a[i]<=avarage){
        poor++;
      }
    }

    cout<<poor<<endl;
  }
  return 0;
}

