#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, pos;
  cin >> n;
  int a[n], i, sum = 0;
  double avg, temp = 10000;
  for (i = 0; i < n; i++) {
    cin >> a[i];
    sum += a[i];
  }
  avg = sum / n;
  for (i = 0; i < n; i++) {
    if (abs(avg - a[i]) < temp) {
      temp = avg - a[i];
      pos = i;
    }
  }
  cout << pos << endl;
  return 0;
}
