#include <bits/stdc++.h>
using namespace std;
int abs(int a) {
  if (a >= 0)
    return a;
  else
    return -a;
}
int main() {
  int N;
  cin >> N;
  int a[100];
  for (int i = 0; i < N; i++) {
    cin >> a[i];
  }
  double avg;
  int sum = 0;
  for (int i = 0; i < N; i++) {
    sum += a[i];
  }
  avg = sum / N;
  int mdif = abs(a[0] - avg);
  int diff = 0;
  for (int i = 0; i < N; i++) {
    int dif = abs(a[i] - avg);
    if (dif < mdif) {
      mdif = dif;
      diff = i;
    }
  }
  cout << diff;
  return 0;
}
