#include <bits/stdc++.h>
#define test(a) printf("(%3d)", a)
typedef long long ll;
typedef unsigned long long ull;
using namespace std;

const int MAXN = 5e4 + 10;

int n, a[MAXN];

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