#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  int a[150];
  double ave;
  double sum = 0;
  int tmp = 0;
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> a[i];
    sum += a[i];
  }
  ave = sum / n;
  for (int i = 0; i < n; i++) {
    if (fabs(ave - a[i]) < fabs(ave - a[i])) tmp = i;
  }
  cout << tmp << endl;
  return 0;
}
