#include <bits/stdc++.h>
using namespace std;
int main() {
  double n = 0;
  cin >> n;
  vector<double> a(n);
  double all = 0;
  for (int i = 0; i < n; i++) cin >> a[i], all += a[i];
  sort(a.begin(), a.end());
  double res = 0;
  double now = 0;
  now = 10000000;
  for (int i = 0; i < n; i++) {
    if (abs(a[i] * n - all) < now) {
      res = i;
      now = abs(a[i] * n - all);
    }
  }
  cout << res << endl;
  return 0;
}
