#include <bits/stdc++.h>
using namespace std;
int main() {
  int N, i, sum;
  cin >> N;
  vector<int> a(N);
  for (i = 0; i < N; i++) {
    cin >> a[i];
    sum += a[i];
  }
  double mean = sum / N;
  double diff = 100 * 100;
  int ans = 0;
  for (i = 0; i < N; i++) {
    if (abs(mean - a[i]) < diff) {
      ans = i;
      diff = abs(mean - a[i]);
    }
  }
  cout << ans << '\n';
}
