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