#include <bits/stdc++.h>
using namespace std;
int main(void) {
  int n;
  int a[100];
  int sum = 0;
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> a[i];
    sum += a[i];
  }
  float ave = sum / n;
  int min = 10000000;
  int idx;
  for (int i = 0; i < n; i++) {
    if (abs(ave - a[i]) < min) {
      idx = i;
      min = abs(ave - a[i]);
    }
  }
  cout << idx << endl;
  return 0;
}
