#include <bits/stdc++.h>
using namespace std;
vector<int> a(101);
int main() {
  int n;
  cin >> n;
  long int sum = 0;
  for (int i = 0; i < n; i++) {
    cin >> a.at(i);
    sum += a.at(i);
  }
  long double he = sum / n;
  long double x = 8784643;
  int ans = 0;
  for (int i = 0; i < n; i++) {
    if (fabs(a.at(i) - he) < x) {
      x = fabs(a.at(i) - he);
      ans = i;
    }
  }
  cout << ans << "\n";
}
