#include <bits/stdc++.h>
using namespace std;
int main(void) {
  int n, a[111];
  cin >> n;
  double ave = 0;
  for (int i = 0; i < n; i++) {
    cin >> a[i];
    ave += a[i];
  }
  ave /= (double)n;
  int ans, min = 22222222;
  for (int i = 0; i < n; i++) {
    double de = abs(ave - a[i]);
    if (min > de) {
      min = de;
      ans = i;
    }
  }
  cout << ans << endl;
}
