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