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