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