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