Go: package main

import "fmt"

func main() {
    var n int
    a := make([]float64, 10004)
    for {
        fmt.Scan(&n)
        if n == 0 { break }

        ave_num := 0.0
        for i := 0; i < n; i++ {
            fmt.Scan(&a[i])
            ave_num += a[i]
        }
        ave_num /= float64(n)
        cnt := 0
        for i := 0; i < n; i++ {
            if a[i] <= ave_num {
                cnt++
            }
        }
        fmt.Println(cnt)
    }
}

C++: #include<iostream>
#include<vector>
using namespace std;
int main()
{
	int n;

	while (cin >> n)
	{	
		if (n == 0) break;
		vector<int> A(n);
		int su = 0, sum = 0;
		
		for (int i = 0; i < n; i++)
		{
			cin >> A[i]; su += A[i];
		}

		int m = su / n;
		for (int i = 0; i < n; i++)
		{
			if (A[i] <= m) sum++;
		}
		cout << sum << endl;
	}
	return 0;
}

C++: #include<iostream>
#include<cstdio>
using namespace std;
int main(){
    int n,sum,counter;
    float average;
    int An[10000];
    while(1){
        scanf("%d",&n);
        if(n == 0) break;
        for(int i=0;i<n;i++){
            scanf("%d",&An[i]);
        }
        sum = 0;
        for(int i=0;i<n;i++){
            sum += An[i];
        }
        average = sum/n;
        counter = 0;
        for(int i=0; i<n; i++){
            if(An[i]<=average){
                counter += 1;
            }
        }
        printf("%d\n",counter);
    }
    return 0;
}

C++: /**
 *    author:  otera    
**/
#include<iostream>
#include<string> 
#include<cstdio>
#include<cstring>
#include<vector>
#include<cmath>
#include<algorithm> 
#include<functional>
#include<iomanip>
#include<queue>
#include<deque>
#include<ciso646>
#include<random>
#include<map>
#include<set>
#include<complex>
#include<bitset>
#include<stack>
#include<unordered_map>
#include<utility>
#include<cassert>
using namespace std;

//#define int long long
typedef long long ll;
typedef unsigned long long ul;
typedef unsigned int ui;
typedef long double ld;
const int inf=1e9+7;
const ll INF=1LL<<60 ;
const ll mod=1e9+7 ;
#define rep(i,n) for(int i=0;i<n;i++)
#define per(i,n) for(int i=n-1;i>=0;i--)
#define Rep(i,sta,n) for(int i=sta;i<n;i++)
#define rep1(i,n) for(int i=1;i<=n;i++)
#define per1(i,n) for(int i=n;i>=1;i--)
#define Rep1(i,sta,n) for(int i=sta;i<=n;i++)
typedef complex<ld> Point;
const ld eps = 1e-8;
const ld pi = acos(-1.0);
typedef pair<int, int> P;
typedef pair<ld, ld> LDP;
typedef pair<ll, ll> LP;
#define fr first
#define sc second
#define all(c) c.begin(),c.end()
#define pb push_back
#define debug(x)  cerr << #x << " = " << (x) << endl;
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }

void solve() {
	int n;
    while(cin >> n) {
        if(n == 0) break;
        vector<int> a(n);
        int sum = 0;
        rep(i, n) {
            cin >> a[i];
            sum += a[i];
        }
        int cnt = 0;
        rep(i, n) {
            if(n * a[i] <= sum) ++ cnt;
        }
        cout << cnt << endl;
    }
}

signed main() {
	ios::sync_with_stdio(false);
	cin.tie(0);
	//cout << fixed << setprecision(10);
	//int t; cin >> t; rep(i, t)solve();
	solve();
    return 0;
}

C++: #include <bits/stdc++.h>
using namespace std;
#define endl "\n"
//#define int long long //Strong Power
#ifdef LOCAL
#define lout cout
#else
stringstream devnull;
#define lout devnull
#endif
#define AMULET \
  cin.tie(0);  \
  ios::sync_with_stdio(false);
// https://github.com/kurokoji/.cpp-Template/blob/master/template/template2.cpp
#define GET_MACRO(_1, _2, _3, _4, NAME, ...) NAME
#define rep(...) GET_MACRO(__VA_ARGS__, rep4, rep3, rep2, rep1) \
(__VA_ARGS__)
#define rep1(n) rep2(_, n)
#define rep2(i, n) rep3(i, 0, n)
#define rep3(i, a, n) rep4(i, a, n, 1)
#define rep4(i, a, n, d) for (decltype(n) i = (a); i < (n); i += (d))
#define rrep(...) GET_MACRO(__VA_ARGS__, rrep4, rrep3, rrep2, rrep1) \
(__VA_ARGS__)
#define rrep1(a) rrep2(_, a)
#define rrep2(i, a) rrep3(i, a, 0)
#define rrep3(i, a, n) rrep4(i, a, n, 1)
#define rrep4(i, a, n, d) for (decltype(a) i = (a); i >= (n); i -= (d))
// -----
typedef long long ll;
typedef long long lint;
typedef pair<int, int> pii;
typedef pair<lint, lint> pll;
template <class C>
inline void vcin(C &c);
template <class C, class D>
inline void vcin(C &c, D &d);
template <class C>
inline void vcout(const C &c, const string separate = "\n");
template <class T = int>
inline T in();

void solve()
{
  while (true)
  {
    int n = in();
    if (n == 0)
    {
      break;
    }
    vector<int> a(n);
    vcin(a);

    int ave = accumulate(a.begin(), a.end(), 0) / a.size();

    int cnt = 0;
    for (auto &&e : a)
    {
      if (e <= ave)
        cnt++;
    }

    cout << cnt << endl;
  }
}

signed main()
{
  AMULET
  solve();
  return 0;
}

template <class C>
inline void vcin(C &c)
{
  for (auto &a : c)
  {
    cin >> a;
  }
}
template <class C, class D>
inline void vcin(C &c, D &d)
{
  for (auto it1 = c.begin(), it2 = d.begin(); it1 != c.end() && it2 != d.end(); it1++, it2++)
  {
    cin >> *it1 >> *it2;
  }
}
template <class C>
inline void vcout(const C &c, const string separate)
{
  for (auto it = c.begin(); it != c.end(); it++)
  {
    if (it != c.begin())
      cout << separate;
    cout << *it;
  }
}
template <class T = int>
inline T in()
{
  T x;
  cin >> x;
  return (x);
}

C++: #include <algorithm>
#include <iostream>
#include <vector>

using namespace std;

typedef long long ll;
typedef pair<ll, ll> P;

#define MOD 1000000007
#define REP(i, N) for (int i = 0; i < N; ++i)
#define REP1(i, N) for (int i = 1; i <= N; ++i)
#define RREP(i, N) for (int i = N - 1; i >= 0; --i)
#define ALL(a) a.begin(), a.end()

int main() {
  int n;
  while (cin >> n) {
    if (n == 0) return 0;
    int a[n];
    int sum = 0;
    REP(i, n) {
      cin >> a[i];
      sum += a[i];
    }
    int ans = 0;
    REP(i, n) if (n * a[i] <= sum) ans++;
    cout << ans << endl;
  }
  return 0;
}

C++: #include <algorithm>
#include <cmath>
#include <iostream>
#include <string>
#include <vector>

using namespace std;
typedef long long int ll;
typedef vector<int> vi;
typedef vector<vi> vvi;

#define INF (1e9)

int N;

int main() {
    while (true) {
        cin >> N;
        if (N == 0) break;

        vi A(N);
        ll sum = 0;
        for (int i = 0; i < N; i++) {
            cin >> A[i];
            sum += A[i];
        }

        float m = sum / N;

        int ans = 0;
        for (int i = 0; i < N; i++) {
            if (A[i] <= m) ans++;
        }

        cout << ans << endl;
    }
    return 0;
}

C++: #include <bits/stdc++.h>
using namespace std;

#define int             long long
#define FOR( i, m, n )  for( int (i) = (m); (i) < (n); (i)++ )
#define REP( i, n )     FOR( i, 0, n )
#define REPR( i, m )    for( int (i) = (m); (i) >= 0; (i)-- )
#define REPONE( i, n )  FOR( i, 1, n + 1 )
#define ALL( a )        (a).begin(), (a).end()
#define MP              make_pair

typedef pair<int, int> P;

template<class T>bool chmax( T& a, const T& b ) { if( a < b ) { a = b; return 1; } return 0; }
template<class T>bool chmin( T& a, const T& b ) { if( a > b ) { a = b; return 1; } return 0; }

const int INF = 1e9;
const int MOD = 1e9 + 7;

signed main(){
    int N;
    while( cin >> N, N ){
        vector<int> a( N );
        int sum = 0;
        REP( i, N ) {
            cin >> a[i];
            sum += a[i];
        }

        double ave = sum / N;
        int ans = 0;
        REP( i, N ){
            if( a[i] <= ave ) ans++;
        }

        cout << ans << endl;
    }
}