#include <bits/stdc++.h>
using namespace std;
void solve() {
  int N;
  cin >> N;
  float as[N], sum = 0;
  for (int i = 0; i < N; i++) {
    cin >> as[i];
    sum += as[i];
  }
  sum /= N;
  int ans = 0;
  float diff = FLT_MAX;
  for (int i = 0; i < N; i++) {
    if (diff > abs(sum - as[i])) {
      diff = abs(sum - as[i]);
      ans = i + 1;
    }
  }
  cout << ans << endl;
}
int main(void) {
  solve();
  return 0;
}
