#include <bits/stdc++.h>
using namespace std;
long long a, aa[110], d = 0;
double b = 0, c = 100;
signed main() {
  cin >> a;
  for (long long i = 0; i < a; i++) {
    cin >> aa[i];
    b += aa[i];
  }
  b = b / a;
  for (long long i = 0; i < a; i++) {
    if (abs(b - aa[i]) < c) {
      d = i;
      c = b - aa[i];
    }
  }
  cout << d;
}
