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