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