#include <bits/stdc++.h>
using namespace std;
double a[102];
int main() {
  double n;
  cin >> n;
  double sum = 0;
  for (long long i = 0; i < n; i++) {
    cin >> a[i];
    sum += a[i];
  }
  sum /= n;
  long long ans = 1;
  double now = abs(sum - a[0]);
  for (long long i = 0; i < n; i++) {
    if (abs(sum - a[i]) < now) {
      now = abs(sum - a[i]);
      ans = i;
    }
  }
  cout << ans;
  return 0;
}
