#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, a[101];
  int min = 1000001;
  double sum = 0;
  int ans;
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> a[i];
    sum += a[i];
  }
  for (int i = 0; i < n; i++) {
    if (min > fabs((sum / n) - a[i])) {
      min = fabs((sum / n) - a[i]);
      ans = i;
    }
  }
  cout << ans << endl;
}
