#include <bits/stdc++.h>
using namespace std;
signed main() {
  long long N;
  cin >> N;
  long long a[N];
  long long sum = 0;
  for (long long i = 0; i < N; i++) {
    cin >> a[i];
  }
  for (long long i = 0; i < N; i++) {
    sum += a[i];
  }
  double m;
  m = sum / (double)N;
  long long k = 300;
  long long index = 0;
  for (long long i = 0; i < N; i++) {
    double temp = abs(m - a[i]);
    if (temp < k) {
      k = temp;
      index = i;
    }
    if (k == 0) {
      cout << i << endl;
      return 0;
    }
  }
  cout << index << endl;
  return 0;
}
