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