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++: 
#if 1
#include <iostream>
#include <fstream>
#include <string>
#include <vector>
#include <map>
#include <set>
#include <unordered_map>
#include <unordered_set>
#include <queue>
#include <stack>
#include <array>
#include <deque>
#include <algorithm>
#include <utility>
#include <cstdint>
#include <functional>
#include <iomanip>
#include <numeric>
#include <assert.h>
#include <bitset>
#include <list>
#include <cmath>
#include <sstream>

#define all_range(C) std::begin(C), std::end(C)



long long A[50000];
int main()
{
	using std::endl;
	using std::cout;
	using std::cin;

	while (true)
	{
		int n;
		cin >> n;
		if (n == 0) { break; }

		long long sum = 0;
		for (int i = 0; i < n; ++i) {
			cin >> A[i];
			sum += A[i];
		}
		long long ave = sum / n;
		int count = 0;
		for (int i = 0; i < n; ++i) {
			if (A[i] <= ave) {
				++count;
			}
		}
		cout << count << endl;
	}

	return 0;
}
#endif

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

int main()
{
  while (true)
  {
    i64 n;
    cin >> n;
    if (n == 0)
      break;
    vector<i64> a(n);
    i64 sum = 0;
    for (i64 i = 0; i < n; i++)
    {
      cin >> a[i];
      sum += a[i];
    }
    i64 ans = 0;
    for (i64 i = 0; i < n; i++)
      if (a[i] <= sum / n)
        ans++;
    cout << ans << endl;
  }
  return 0;
}

C++: #include <bits/stdc++.h>
using namespace std;
#define min(a,b) ((a)<(b)?(a):(b))
#define max(a,b) ((a)>(b)?(a):(b))
#define REP(i,n) for(int i=0;i<n;i++)
#define FOR(i,n1,n2) for(int i=n1;i<n2;i++)
#define speed_up    ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);

typedef long long int ll;
typedef pair<ll,ll> Pi;
const int INF=(ll)(1LL<<31)-1;
const ll INFl=(ll)9223372036854775807;
const int MAX=10000;
const ll MOD=(ll)1e9+7;
ll gcd(ll a,ll b){return b?gcd(b,a%b):a;}
ll lcm(ll a,ll b){return a/gcd(a, b)*b;}
//int dx[4]={1,0,-1,0},dy[4]={0,1,0,-1};

template<typename A, size_t N, typename T>
void Fill(A (&array)[N], const T &val){
    std::fill( (T*)array, (T*)(array+N), val );
}

int n;
int a[10010];

int main(){
	while(1){
		int sum=0;
		cin>>n;
		if(n==0){
			break;
		}
		
		for(int i=0;i<n;i++){
			cin>>a[i];
			sum+=a[i];
		}
		double ave;
		ave=(double)sum/n;
		int ans=0;
		for(int i=0;i<n;i++){
			if(ave>=a[i])
				ans++;
		}
		cout<<ans<<endl;
	}
	return 0;
}

C++: #include <vector>
#include <cstdio>
int main(){
	int N,r,s,i;
	for(;~scanf("%d",&N)&&N;printf("%d\n",r)){
		std::vector<int>a(N);
		for(s=i=0;i<N;i++)scanf("%d",&a[i]),s+=a[i];
		for(r=i=0;i<N;i++)r+=a[i]*N<=s;
	}
}

C++: #include <bits/stdc++.h>

#define TYPE(c)   remove_reference_t<decltype(c)>
#define REP(i, n) for(TYPE(n) i = 0; i < n; i++)
#define FOR(v, c) for(TYPE(c.begin()) v = c.begin(); v != c.end(); v++)
#define ALL(c)    c.begin(), c.end()
#define SORT(c)   sort(ALL(c))
#define RSORT(c)  sort(ALL(c), greater<TYPE(c)::value_type>())
#define UNIQUE(c) c.erase(unique(ALL(c)), c.end())

using namespace std;
using ll = long long;

constexpr int MOD  = (int)1e9 + 7;
constexpr int INF  = (int)1e9 + 1;
constexpr ll  LINF = (ll)1e18 + 1;
template<typename T> constexpr bool chmax(T& a, const T& b)
{ if(a < b) { a = b; return true; } else { return false; } }
template<typename T> constexpr bool chmin(T& a, const T& b)
{ if(b < a) { a = b; return true; } else { return false; } }
template<typename S, typename T> ostream& operator<<(ostream &os, const pair<S, T>& p)
{ return os << "(" << p.first << "," << p.second << ")"; }
ostream& operator<<(ostream &os, const string& s)
{ FOR(v, s) os << *v; return os; }
template<typename T> auto operator<<(ostream& os, const T& t)
    -> typename conditional<true, ostream&, decltype(*t.begin())>::type
{ os << "["; FOR(v, t) { if(v != t.begin()) os << ","; os << *v; } os << "]"; return os; }

int main() {
    cin.tie(0);
    ios::sync_with_stdio(false);

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

        std::vector<int> A(N);
        REP(i, N) {
            std::cin >> A[i];
        }
        auto ave = accumulate(ALL(A), 0LL) / A.size();

        auto ans = 0;
        REP(i, N) {
            if(A[i] <= ave) ans++;
        }
        std::cout << ans << std::endl;
    }

    return 0;
}

C++: #include <iostream>
#include <cstdio>
#include <cstring>
#include <algorithm>
using namespace std;

int n;
int a[10005];

int main(){
	while(scanf("%d", &n) == 1){
		long long ans = 0;
		if(n == 0)
			break;
		for(int i= 1; i <= n; i++){
			scanf("%d", &a[i]);
			ans += a[i];
		}
		double sum = ans;
		ans = 0;
		sum /= n;
		for(int i= 1; i<= n; i++){
			if(a[i] <= sum)
				ans++;
		}
		printf("%d\n", ans);
	}	
return 0;
}

C++: #include <bits/stdc++.h>

using namespace std;

void solve(int n){

    vector<int> a(n);

    for(int i = 0; i < n; i++){
        cin >> a[i];
    }

    long long sum = accumulate(a.begin(), a.end(), 0);
    double mean = sum / (double)n;

    int ans = 0;
    for(int i = 0; i < n; i++){
        if(a[i] <= mean){
            ans++;
        }
    }

    cout << ans << endl;

    return;
}

int main(){

    int n;
    while(cin >> n, n){
        solve(n);
    }

    return 0;
}

C++: #include <bits/stdc++.h>
using namespace std;
#define int long long
#define ll long long
#define fi first
#define se second
#define pb push_back
#define rep(i, s, n) for (int i = s; i < n; i++)
#define rrep(i, s, n) for (int i = (n)-1; i >= (s); i--)
#define all(a) a.begin(),a.end()
typedef pair<int,int>pint;
typedef vector<int>vint;
typedef vector<pint>vpint;
const long long MOD = 1000000007, INF = 1e17;
 
#define endl '\n'
#define IOS() ios_base::sync_with_stdio(0);cin.tie(0)
 
template<class T>inline bool chmax(T& a,T b){if(a<b){a=b;return true;}return false;}
template<class T>inline bool chmin(T& a,T b){if(a>b){a=b;return true;}return false;}



signed main()
{
	//IOS();
	vector<int>ans;
	while(1){
		int N;
		cin>>N;
		if(N==0)break;
		vector<double>a(N);
		int sum = 0;
		rep(i,0,N){
			cin>>a[i];
			sum += a[i];
		}
		double ave =(double) sum / N;
		int cnt = 0;
		rep(i,0,N){
			if(a[i]<=ave)cnt++;
		}
		ans.push_back(cnt);
	}
	for(auto e:ans){
		cout<<e<<endl;
	}
}

C++: #include<iostream>
#include<string>
#include<cstdio>
#include<vector>
#include<cmath>
#include<algorithm>
#include<functional>
#include<iomanip>
#include<queue>
#include<ciso646>
#include<random>
#include<map>
#include<set>
#include<complex>
#include<bitset>
#include<stack>
#include<unordered_map>
using namespace std;
typedef long long ll;
typedef unsigned int ui;
const ll mod = (1e+9)+7;
const ll INF = (ll)1000000007 * 1000000007;
typedef pair<int, int> P;
#define stop char nyaa;cin>>nyaa;
#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 long double ld;
typedef complex<ld> Point;
const ld eps = 1e-8;
const ld pi = acos(-1.0);
typedef pair<ll, ll> LP;
typedef pair<ld, ld> LDP;
ll a[1 << 14];
int main(){
	int n;
	while (cin >> n, n) {
		ll sum = 0;
		rep(i, n) {
			cin >> a[i]; sum += a[i];
		}
		ll ave = sum / n;
		sort(a, a + n);
		int out = upper_bound(a, a + n, ave) - a;
		cout << out << endl;
	}
	return 0;
}