#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  double ave = 0;
  vector<double> arr;
  for (int i = 0; i < n; i++) {
    double tmp;
    cin >> tmp;
    arr.push_back(tmp);
    ave += tmp / n;
  }
  double min = 10000;
  int min_frame = 0;
  for (int i = 0; i < n; i++) {
    if (abs(arr[i] - ave) < min) {
      min = abs(arr[i] - ave);
      min_frame = i;
    }
  }
  cout << min_frame << endl;
  return 0;
}
