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