#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  double sum = 0, average;
  int a[105];
  for (int i = 0; i < n; i++) {
    cin >> a[i];
    sum += a[i];
  }
  for (int i = 0; i < n; i++) {
    a[i] -= sum / n;
  }
  int minn = 999;
  int k;
  for (int i = 0; i < n; i++) {
    if (abs(a[i]) < minn) {
      k = i;
      minn = abs(a[i]);
    }
  }
  printf("%d", k);
  return 0;
}
