#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  double age;
  double num[110];
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> num[i];
    age += num[i];
  }
  age /= n;
  int ans;
  for (int j = 0; j < n; j++) {
    int x = 10000000;
    if (x > abs(age - num[j])) {
      ans = j;
      x = abs(age - num[j]);
    }
  }
  cout << ans << endl;
}
