#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  vector<int> a(n);
  for (int i = 0; i < n; i++) {
    cin >> a.at(i);
  }
  int he = 0;
  double hei = 0;
  for (int i = 0; i < n; i++) {
    he += a.at(i);
  }
  hei = he / n;
  double x = 101;
  int ans = 0;
  for (int i = 0; i < n; i++) {
    if (abs(a.at(i) - hei) < x) {
      x = abs(a.at(i) - hei);
      ans = i;
    }
  }
  cout << ans << "\n";
}
