#include <bits/stdc++.h>
using namespace std;
template <typename Tn>
Tn gcd(Tn a, Tn b) {
  return (b ? gcd(b, a % b) : a);
}
template <typename Tn>
Tn lcm(Tn a, Tn b) {
  return a / gcd(a, b) * b;
}
long long int cnt = 0;
int dx[] = {1, 0, -1, 0};
int dy[] = {0, 1, 0, -1};
int main() {
  int a[101];
  int n;
  cin >> n;
  double ave = 0;
  for (int i = 0; i < n; i++) {
    cin >> a[i];
    ave += a[i];
  }
  ave /= (double)n;
  sort(a, a + n);
  double sa = 1000;
  int ans = 0;
  for (int i = n - 1; i >= 0; i--) {
    if (sa >= abs(ave - (double)a[i])) {
      ans = i;
      sa = abs(ave - (double)a[i]);
    }
  }
  cout << ans << endl;
  return 0;
}
