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