#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  int a[100];
  int l;
  int m = 100;
  int sum = 0;
  double ave;
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> a[i];
    sum += a[i];
  }
  ave = (double)sum / n;
  for (int i = 0; i < n; i++) {
    if ((double)abs(a[i] - ave) < m) {
      m = abs((double)a[i] - ave);
      l = i;
    }
  }
  cout << l << endl;
  return 0;
}
