#include <iostream>
using namespace std;
 
int main(){
  int n,ans;
  double ave,sum;
 
  while(1){
    cin >> n;
    if(n==0){
      break;
    }
 
    int a[n];
 
    for(int i=0;i<n;i++){
      cin >> a[i];
      sum += a[i];
    }
    ave = sum / n;
 
    for(int i=0;i<n;i++){
      if(ave >= a[i]){
        ans++;
      }
    }
 
    cout << ans << endl;
    sum = 0;
    ans = 0;
  }
 
  return 0;
}
