#include <bits/stdc++.h>
using namespace std;
int arr[109];
int main() {
  int i, n, ind = 0, mini = 100000;
  double sum = 0.0;
  cin >> n;
  for (i = 0; i < n; i++) {
    cin >> arr[i];
    sum += arr[i];
  }
  double avg = sum / n;
  for (i = 0; i < n; i++) {
    double dif = abs(avg - arr[i]);
    if (dif < mini) {
      ind = i;
      mini = dif;
    }
  }
  cout << ind << endl;
}
