#include <bits/stdc++.h>
using namespace std;
double a[10005];
int main() {
  int n;
  int m;
  cin >> n;
  double sum = 0;
  for (int i = 0; i < n; i++) {
    scanf("%d", &m);
    sum += m;
    a[i] = m;
  }
  double ave = sum / n;
  int minn = 100000;
  int temp;
  for (int i = 0; i < n; i++) {
    if (abs(a[i] - ave) < minn) {
      minn = abs(a[i] - ave);
      temp = i;
    }
  }
  cout << temp << endl;
}
