#include <bits/stdc++.h>
using namespace std;
int main(void) {
  cin.tie(0);
  ios::sync_with_stdio(false);
  int N;
  cin >> N;
  int sum = 0;
  int A[110];
  for (int i = 0; i < N; i++) {
    cin >> A[i];
    sum += A[i];
  }
  int ans = 0;
  double ave = (double)sum / N;
  double diff = abs(ave - A[0]);
  for (int i = 0; i < N - 1; i++) {
    if (diff - 0.1 > abs(ave - A[i + 1])) {
      ans = i + 1;
      diff = abs(ave - A[i + 1]);
    }
  }
  cout << ans << endl;
  return 0;
}
