#include <bits/stdc++.h>
using namespace std;
float absss(float a) { return (a >= 0) ? a : -a; }
int main() {
  int n, b, f = 0;
  cin >> n;
  float a[n], sum = 0, ff = 101;
  for (int i = 0; i < n; i++) {
    cin >> a[i];
    sum += a[i];
  }
  sum /= n;
  for (int i = 0; i < n; i++) {
    b = absss(a[i] - sum);
    if (b < ff) {
      ff = b;
      f = i;
    }
  }
  cout << f << "\n";
}
