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