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