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