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 <bits/stdc++.h>
using namespace std;

int main() {
    cin.tie(0);
    ios::sync_with_stdio(false);
    int n, a[n], ans, mean;

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

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

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

C++: #include <iostream>
#include <vector>
#include <string>
#include <map>
#include <set>
#include <algorithm>


using namespace std;


#define REP(i, n) for (int (i) = 0; (i) < (n); (i)++)

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

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

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

    cout << count << endl;
    

  }
  
  

  return 0;
}

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



int main(){
  int n,i,sum=0,count=0;
  double mean;
  int a[10000];

  
  while(1){
    cin >> n;
    if(n==0){
      break;
    }
    count=0;
    sum=0;
    for(i=0;i<n;i++){
      cin >> a[i];
      sum += a[i];
    }
    mean=sum/n;
    for(i=0;i<n;i++){
      if(a[i]<=mean){
	count++;
      }
    }
    cout << count << endl;
  }
  
  return 0;
}

C++: #include "bits/stdc++.h"
using namespace std;
#define int long long
#define endl '\n'
int mod=1e9+7;
int mod2=998244353;

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

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

using namespace std;
int main(){
    int n;
    while(cin >> n, n){
        vector<int> a(n);
        int sum = 0;
        for(auto&& x:a)cin >> x;
        for(auto&& x:a)sum += x;
        sum /= n;
        int ret = 0;
        for(auto&& x:a)if(x <= sum)ret++;
        cout << ret << endl;
    }
}

C++: #include<bits/stdc++.h>
using namespace std;
int main(){
while(true){
	int a,b,c,d;
	cin >> a;
	if(a==0){
		break;
	}
	int syo[a]={};
	c=0;
	for(int n=0;a>n;n++){
		cin >> b;
		syo[n]=b;
		c=c+b;
		}
	int hei=c/a;
	d=0;
	for(int m=0;a>m;m++){
		if(syo[m]<=hei){
			d++;
		}
	}
	printf("%d\n",d);
	}
}

C++: 
#include <iostream>
#include <algorithm>
#include <math.h>

using namespace std;

int main() {
	int n;
	long long int sumer = 0;
	int temp;
	int ave;
	int data[60000];
	int result[60000] = {};
	int count;
	for (count = 0; true; count++) {
		cin >> n;
		sumer = 0;
		temp = 0;
		if (n == 0) break;
		for (int i = 0; i < n; i++) {
			cin >> temp;
			data[i] = temp;
			sumer += temp;
		}
		ave = sumer / n;
		for (int i = 0; i < n; i++) {
			if (data[i] <= ave) {
				result[count]++;
			}
		}
		
	}
	for (int i = 0; i < count; i++) {
		cout << result[i] << endl;
	}
	return 0;
}
/*
//単一連結リストの実装
struct ListNode {
	int data;
	struct ListNode* next;
};*//*
int ListLength(struct ListNode* head) {
	struct ListNode* current = head;
	int count = 0;
	while (current != NULL) {
		count++;
		current = current -> next;
	}
	return count;
}


int main()
{
	int n = 0;
	int owari = 11451414;
	int result[50010] = {};
	int sa = owari;
	int count = 0;
	while (true) {
		int dataset[50010];
		cin >> n;
		if (n == 0) break;
		for (int i = 0; i < n; i++) {
			cin >> dataset[i];
		}
		sort(dataset, dataset + n);
		sa = owari;
		for (int i = 1; i < n; i++) {
			if (abs(dataset[i] - dataset[i - 1]) < sa) {
				sa = abs(dataset[i] - dataset[i - 1]);
			}
		}
		result[count] = sa;
		count++;
	}
	for (int i = 0; i < count; i++) {
		cout << result[i] << endl;
	}
	return 0;
}
*/

C++: #include<bits/stdc++.h>
using namespace std;
using ll = long long;
using VI = vector<ll>;
using VV = vector<VI>;
using VS = vector<string>;

// tourist set
template <typename A, typename B>
string to_string(pair<A, B> p);

template <typename A, typename B, typename C>
string to_string(tuple<A, B, C> p);

template <typename A, typename B, typename C, typename D>
string to_string(tuple<A, B, C, D> p);

string to_string(const string& s) {
  return '"' + s + '"';
}

string to_string(const char* s) {
  return to_string((string) s);
}

string to_string(bool b) {
  return (b ? "true" : "false");
}

string to_string(vector<bool> v) {
  bool first = true;
  string res = "{";
  for (int i = 0; i < static_cast<int>(v.size()); i++) {
    if (!first) {
      res += ", ";
    }
    first = false;
    res += to_string(v[i]);
  }
  res += "}";
  return res;
}

template <size_t N>
string to_string(bitset<N> v) {
  string res = "";
  for (size_t i = 0; i < N; i++) {
    res += static_cast<char>('0' + v[i]);
  }
  return res;
}

template <typename A>
string to_string(A v) {
  bool first = true;
  string res = "{";
  for (const auto &x : v) {
    if (!first) {
      res += ", ";
    }
    first = false;
    res += to_string(x);
  }
  res += "}";
  return res;
}

template <typename A, typename B>
string to_string(pair<A, B> p) {
  return "(" + to_string(p.first) + ", " + to_string(p.second) + ")";
}

template <typename A, typename B, typename C>
string to_string(tuple<A, B, C> p) {
  return "(" + to_string(get<0>(p)) + ", " + to_string(get<1>(p)) + ", " + to_string(get<2>(p)) + ")";
}

template <typename A, typename B, typename C, typename D>
string to_string(tuple<A, B, C, D> p) {
  return "(" + to_string(get<0>(p)) + ", " + to_string(get<1>(p)) + ", " + to_string(get<2>(p)) + ", " + to_string(get<3>(p)) + ")";
}

void debug_out() { cerr << '\n'; }

template <typename Head, typename... Tail>
void debug_out(Head H, Tail... T) {
  cerr << " " << to_string(H);
  debug_out(T...);
}

#ifdef LOCAL
#define debug(...) cerr << "[" << #__VA_ARGS__ << "]:", debug_out(__VA_ARGS__)
#else
#define debug(...) 42
#endif
// tourist set end

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 (b<a) { a=b; return 1; } return 0; }

#define FOR(i,a,b) for(ll i=(a);i<(b);++i)
#define rep(i,b) FOR(i, 0, b)
#define ALL(v) (v).begin(), (v).end()
#define p(s) cout<<(s)<<'\n'
#define p2(s, t) cout << (s) << " " << (t) << '\n'
#define br() p("")
#define pn(s) cout << (#s) << " " << (s) << '\n'
#define p_yes() p("YES")
#define p_no() p("NO")
#define SZ(x) ((int)(x).size())
#define SORT(A) sort(ALL(A))
#define RSORT(A) sort(ALL(A), greater<ll>())

void no(){p_no(); exit(0);}
void yes(){p_yes(); exit(0);}

const ll mod = 1e9 + 7;
const ll inf = 1e18;
const double PI = acos(-1);

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

    // input
    ll N; 
    
    while(cin>>N){
      if(N==0) return 0;
      VI A(N);
      rep(i, N) cin>>A[i];

      double mean = 0;
      rep(i, N) mean+=A[i];
      mean /= N;

      ll cnt = 0;
      rep(i, N){
        if(mean>=(double)A[i]) cnt++;
      }
      p(cnt);
    }
    
    return 0;
}