Go: package main

import "fmt"

func main() {

     for ; true ; {
     var n int
     fmt.Scan(&n)
     if n == 0 { break }
     a := make([]float64, n)
     var sum float64 = 0
     for i := 0; i < n; i++ {
     	 fmt.Scan(&a[i])
	 sum += float64(a[i])
     }
     sum /= float64(n)
     ans := 0
     for i := 0; i < n; i++ {
     	 if a[i] <= sum {
	    ans += 1
	 }
     }
     fmt.Println(ans)
     }
}

C++: #ifndef _GLIBCXX_NO_ASSERT
#include <cassert>
#endif
#include <cctype>
#include <cerrno>
#include <cfloat>
#include <ciso646>
#include <climits>
#include <clocale>
#include <cmath>
#include <csetjmp>
#include <csignal>
#include <cstdarg>
#include <cstddef>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>

#if __cplusplus >= 201103L
#include <ccomplex>
#include <cfenv>
#include <cinttypes>
#include <cstdbool>
#include <cstdint>
#include <ctgmath>
#include <cwchar>
#include <cwctype>
#endif

// C++
#include <algorithm>
#include <bitset>
#include <complex>
#include <deque>
#include <exception>
#include <fstream>
#include <functional>
#include <iomanip>
#include <ios>
#include <iosfwd>
#include <iostream>
#include <istream>
#include <iterator>
#include <limits>
#include <list>
#include <locale>
#include <map>
#include <memory>
#include <new>
#include <numeric>
#include <ostream>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <stdexcept>
#include <streambuf>
#include <string>
#include <typeinfo>
#include <utility>
#include <valarray>
#include <vector>

#if __cplusplus >= 201103L
#include <array>
#include <atomic>
#include <chrono>
#include <condition_variable>
#include <forward_list>
#include <future>
#include <initializer_list>
#include <mutex>
#include <random>
#include <ratio>
#include <regex>
#include <scoped_allocator>
#include <system_error>
#include <thread>
#include <tuple>
#include <typeindex>
#include <type_traits>
#include <unordered_map>
#include <unordered_set>
#endif

using namespace std;
typedef long long ll;
typedef pair<int,int> Pint;
typedef pair<ll, ll> P;
//typedef pair<int, pair<int, int>> P;
//typedef tuple<int,int,int> T;
ll INFL = 1000000000000000010;//10^18 = 2^60
int INF = 2147483600;//10^9
ll MOD  = 1000000007;
vector<int> dy = {0,0,1,-1};
vector<int> dx = {1,-1,0,0};

void solve(){
  while(true){
    int N; cin >> N;
    if(N == 0) break;
    vector<int> A(N);
    int sum = 0;
    for(int i = 0; i < N; i++){
      cin >> A[i];
      sum += A[i];
    }
    int ans = 0;
    for(int i = 0; i < N; i++){
      if(A[i] * N <= sum) ans++;
    }
    cout << ans << endl;
  }
}

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

    solve();
}

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

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

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

int main(){
    int n;
    while(cin >> n, n){
        vector<int> a(n);
        int ave = 0;
        for(int i = 0 ; i < n ; ++i){
            cin >> a[i];
            ave += a[i];
        }
        ave /= n;
        int ans = 0;
        for(int i = 0 ; i < n ; ++i){
            ans += a[i] <= ave;
        }

        cout << ans << endl;
    }
}

C++: #include <cstdio>
#include <algorithm>
using namespace std;
int p[10001];

int main()
{
    int n, sum, avg;
    for (;; ){
        scanf("%d", &n);
        if (n == 0) break;
        sum = 0;
        for (int i = 0; i < n; i++) { scanf("%d", &p[i]); sum+= p[i]; }
        avg = sum / n;
        sort(p, p+n);
        int left = int(upper_bound(p, p+n, avg)-p);
        printf("%d\n", left);
    }
    return 0;
}

C++: #include <bits/stdc++.h>
using namespace std;
 
bool solve() {
    int N;
    cin >> N;
    if(!N) return false;
 
    vector<int> A(N);
    int sum = 0;
    for(int &e : A) {
        cin >> e;
        sum += e;
    }
 
    int ans = 0;
    for(int i = 0; i < N; i++) if(N * A[i] <= sum) ans++;
    cout << ans << endl;
    return true;
}
 
int main() {
    while(solve());
    return 0;
}

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


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

C++: #include<bits/stdc++.h>
#define rep(i,a,b) for(int i=int(a);i<int(b);++i)
using namespace std;
typedef long long ll;
int INF = (1LL << 30) - 1;
int MOD = 1e9+7;
main(){
    int N;
    cin >> N;
    while(N){
        vector<int> V(N);
        rep(i,0,N)cin >> V[i];
        ll sum = 0;
        rep(i,0,N)sum += V[i];
        int cnt = 0;
        rep(i,0,N)if(V[i] <= sum / N)cnt++;
        cout << cnt << endl;
        cin >> N;
    }
}

C++: #include <bits/stdc++.h>
#define r(i,n) for(int i=0;i<n;i++)
using namespace std;

int n,a[100001];

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

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

int main(){
    int n;
    while(cin >> n, n){
        vector<int> A(n);
        for(auto &v: A)
            cin >> v;
        
        int sum = 0;
        for(auto v: A)
            sum += v;
        
        int count = 0;
        for(auto v: A)
            count += v*n <= sum;
        
        cout << count << endl;
    }
    
    return 0;
}

C++: #include <iostream>
#include <algorithm>
#include <vector>
#include <cmath>
using namespace std;
int main()
{
    while(true)
    {
        int n;cin>>n;if(n==0){break;}double ave=0;
        vector<double >a(n);
        for(int i=0;i<n;i++){
            cin>>a[i];ave+=a[i];
        }
        ave/=(double)n;
     int count=0;
        for(int i=0;i<n;i++){
            if(a[i]<=ave){count++;}
        }
    cout<<count<<endl;}
    return 0;
}

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

typedef long double ld;

double a[10005];
ld sum = 0, avg = 0;

int main() {
	
	int n;
	cin >> n;

	int cnt;

	while (n != 0) {
		sum = 0;
		cnt = 0;
		for (int i = 0; i < n; i++) {
			cin >> a[i];
			sum += a[i];
		}
		avg = sum / (double)n;
		for (int i = 0; i < n; i++) {
			if (a[i] <= avg) {
				cnt++;
			}
		}
		cout << cnt << endl;
		cin >> n;
	}

	return 0;
}

C++: #include <iostream>
#include<string>
#include<cmath>
#include<algorithm>
#include<cctype>
#include<queue>
#include<deque>
#include<regex>
#include<stack>
#include<stdio.h>
#include<vector>
#include<set>
#include<map>
#include<iomanip>

using namespace std;

#define rep(i,n) for(int i=0;i<n;i++)
typedef int long long ll;

int main() {
int n;
while(true){
    cin>>n;if(n==0)break;
    vector<int> v(n);
    int sum=0;
    int  ave=0;
    int ans=0;
    rep(i,n){
        cin>>v[i];
        sum+=v[i];
    }
    ave=(sum)/(n);
    rep(i,n){
        if(ave>=v[i])ans++;
    }
    cout<<ans<<endl;




}
    return 0;
}