#include <bits/stdc++.h>
#define int long long
#define double long double
#define INF 1e18
#define MOD 1000000007
using namespace std;
signed main() {
  int N;
  while(cin>>N,N){
  vector<int> a(N);
  int avg = 0;
  for (int i=0;i<N;i++) {
    cin>>a[i];
    avg+=a[i];
  }
  avg/=N;
  int ans=0;
  for (int i=0;i<N;i++) {
    if(a[i]<=avg)ans++;
  }
  cout<<ans<<endl;
  }
}

