#include <bits/stdc++.h>
using namespace std;
int a[105];
int N;
int main(void) {
  cin >> N;
  for (int i = 0; i < N; i++) {
    cin >> a[i];
  }
  double sum = 0.0;
  for (int i = 0; i < N; i++) {
    sum += a[i];
  }
  double ave = sum / double(N);
  int ans = 0;
  double x = 1000000.0;
  for (int i = 0; i < N; i++) {
    if (abs(ave - 1.0 * a[i]) < x) {
      ans = i;
      x = abs(ave - 1.0 * a[i]);
    }
  }
  cout << ans << endl;
  return 0;
}
