#include <bits/stdc++.h>
using namespace std;
int main(void) {
  int n;
  int b = 0;
  int minn = 0;
  cin >> n;
  int a[n];
  for (int i = 0; i < n; i++) {
    cin >> a[i];
    b += a[i];
  }
  double ave = b / n * 1.0;
  double min = 1000.0;
  for (int i = 0; i < n; i++) {
    if (min > fabs(ave - a[i] * 1.0)) {
      min = fabs(ave - a[i] * 1.0);
      minn = i;
    }
  }
  cout << minn << endl;
}
