#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, a[101];
  int df = 1e9;
  double avg = 0;
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> a[i];
    avg += a[i];
  }
  avg /= n;
  int ans = 0;
  for (int i = 0; i < n; i++) {
    if (abs(a[i] - avg) < df) {
      df = abs(a[i] - avg);
      ans = i;
    }
  }
  cout << ans << endl;
  return 0;
}
