#include <bits/stdc++.h>
using namespace std;
int main() {
  int a;
  cin >> a;
  vector<int> vec(a);
  int sum = 0;
  for (int i = 0; i < a; i++) {
    cin >> vec.at(i);
    sum += vec.at(i);
  }
  int heikin = sum / a;
  int answer = 0;
  int sa = 1000;
  for (int i = 0; i < a; i++) {
    if (abs(heikin - vec.at(i)) < sa) {
      answer = i;
      sa = abs(heikin - vec.at(i));
    }
  }
  cout << answer << endl;
}
