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