#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  int a[110];
  cin >> n;
  double ave = 0;
  for (int i = 0; i < n; i++) {
    cin >> a[i];
    ave += a[i];
  }
  float x = n;
  ave /= x;
  int minn = 1e9;
  int ans = 0;
  for (int i = 0; i < n; i++) {
    double temp = a[i] - ave;
    if (temp < 0) {
      temp = 0 - temp;
    }
    if (temp < minn) {
      minn = temp;
      ans = i;
    }
  }
  cout << ans;
  return 0;
}
