#include <bits/stdc++.h>
using namespace std;
int main() {
  int a[100];
  int n;
  cin >> n;
  int sum = 0;
  float s = 101.0;
  int id = -1;
  float heikin = 0;
  for (int i = 0; i < n; i++) {
    cin >> a[i];
  }
  for (int i = 0; i < n; i++) {
    sum += a[i];
  }
  heikin = (float)sum / n;
  for (int i = 0; i < 100; i++) {
    if (s > abs((float)a[i] - heikin)) {
      id = i;
      s = abs((float)a[i] - heikin);
    }
  }
  cout << id << endl;
}
