#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  int n, s = 0, ans;
  double ave, min = 100;
  cin >> n;
  vector<int> a(n);
  for (int i = 0; i < n; i++) {
    cin >> a[i];
    s += a[i];
  }
  ave = (double)s / n;
  sort(a.begin(), a.end());
  for (int i = 0; i < n; i++) {
    if (abs(ave - a[i]) < min) {
      min = abs(ave - a[i]);
      ans = i;
    }
  }
  cout << ans << endl;
  return 0;
}
