#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  int a[110];
  cin >> n;
  float ave = 0;
  for (int i = 0; i < n; i++) cin >> a[i], ave += a[i];
  ave = ave / n;
  int pos = 0;
  a[0] = abs(a[0] - ave);
  for (int i = 1; i < n; i++) {
    a[i] = abs(a[i] - ave);
    if (a[pos] > a[i]) pos = i;
  }
  cout << pos;
  return 0;
}
