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