#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  int a[110];
  cin >> n;
  float ave = 0;
  for (int i = 0; i < n; i++) {
    cin >> a[i];
    ave += a[i];
  }
  ave /= n;
  int minn = 1e9;
  int ans = 0;
  for (int i = 0; i < n; i++) {
    if (abs(a[i] - ave) < minn) {
      minn = abs(a[i] - ave);
      ans = i;
    }
  }
  cout << ans;
  return 0;
}
