#include <bits/stdc++.h>
using namespace std;
int main() {
  int a;
  cin >> a;
  double c = 0;
  double y = a;
  double b[a], ans = 0;
  for (int i = 0; i < a; i++) {
    cin >> b[i];
    c += b[i];
  }
  c = c / y;
  double d = abs(c - b[0]);
  for (int i = 1; i < a; i++) {
    if (d >= abs(b[i] - c)) {
      d = abs(b[i] - c);
      ans = i;
    }
  }
  cout << ans << endl;
  return 0;
}
