#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, sum = 0, min = 1000, loc;
  cin >> n;
  vector<int> data(n);
  for (int i = 0; i < n; i++) {
    cin >> data.at(i);
  }
  for (int i = 0; i < n; i++) {
    sum += data.at(i);
  }
  sum = sum / n;
  for (int i = 0; i < n; i++) {
    if (min > abs(data.at(i) - sum)) {
      loc = i;
      min = abs(data.at(i) - sum);
    }
  }
  cout << loc;
}
