#include <bits/stdc++.h>
using namespace std;
int main(void) {
  int n;
  vector<int> a(100);
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> a.at(i);
  }
  int ave;
  int sum = 0;
  for (int i = 0; i < n; i++) {
    sum += a.at(i);
  }
  ave = sum / n;
  int min = 999;
  int min_index = 999;
  for (int i = 0; i < n; i++) {
    int temp = abs(ave - a.at(i));
    if (min > temp) {
      min = temp;
      min_index = i;
    }
  }
  cout << min_index << endl;
  return 0;
}
