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