#include <bits/stdc++.h>
using namespace std;
int N;
double a[100];
int main() {
  cin >> N;
  int s = 0;
  for (int i = 0; i < N; i++) {
    cin >> a[i];
    s += a[i];
  }
  double m = s / N;
  double min = 100;
  int num = 0;
  for (int i = 0; i < N; i++) {
    if (abs(a[i] - m) < min) {
      min = abs(a[i] - m);
      num = i;
    }
  }
  cout << num << endl;
  return 0;
}
