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