#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, i, a[110], ans;
  double ave = 0, b, c = 2100000000;
  cin >> n;
  for (i = 1; i <= n; i++) {
    cin >> a[i];
    ave += a[i];
  }
  ave /= n;
  for (i = 1; i <= n; i++) {
    b = a[i];
    if (c > abs(ave - b)) {
      c = abs(ave - b);
      ans = i - 1;
    }
  }
  cout << i - 1 << endl;
}
