#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  int a[110] = {};
  double num = 0.0;
  double hoge = 0.0;
  int count = 100000;
  int number = 0;
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> a[i];
    num += a[i];
  }
  num = num / n;
  for (int i = 0; i < n; i++) {
    hoge = abs(num - a[i]);
    if (hoge < count) {
      count = hoge;
      number = i;
    }
  }
  cout << number << endl;
}
