#include<cstdio>
using namespace std;
typedef long long ll;

ll n, a[10000], ans, sum;

int main() {
  while (scanf("%lld", &n), n) {
    sum = ans = 0;
    for (ll i = 0; i < n; i++) scanf("%lld", &a[i]), sum += a[i];
    for (ll i = 0; i < n; i++) if (a[i] * n <= sum) ans++;
    printf("%lld\n", ans);
  }
}

