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