#include <bits/stdc++.h>
using namespace std;
int main() {
  int N;
  cin >> N;
  int a[N];
  int ave = 0;
  for (int i = 0; i < N; i++) {
    cin >> a[i];
    ave += a[i];
  }
  ave = ave / N;
  int tmp = 202;
  int tmpa = 202;
  for (int i = 0; i < N; i++) {
    if (tmp > abs(a[i] - ave)) {
      tmp = abs(a[i] - ave);
      tmpa = i;
    }
  }
  cout << tmpa << endl;
}
