#include <bits/stdc++.h>
using namespace std;
int main() {
  int N;
  cin >> N;
  vector<int> a(N, 0);
  for (int i = 0; i < N; i++) {
    cin >> a[i];
  }
  int sum = 0;
  double ave = 0;
  double absmin = 101;
  int ans = 0;
  for (int i = 0; i < N; i++) {
    sum += a[i];
  }
  ave = sum / N;
  for (int j = 0; j < N; j++) {
    if (abs(a[j] - ave) < absmin) {
      absmin = abs(a[j] - ave);
      ans = j;
    }
  }
  cout << ans << endl;
}
