#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int main() {
  ll n = -1;
  while (n != 0) {
    ll sum = 0;
    cin >> n;
    if (n == 0)
      return 0;
    vector<ll> a;
    for (int i = 0; i < n; i++) {
      int x;
      cin >> x;
      a.push_back(x);
      sum += x;
    }
    double mean = sum * 1.0 / n;
    int cnt = 0;
    for (int i = 0; i < n; i++)
      if (a[i] <= mean)
        cnt++;
    cout << cnt << endl;
  }
}
