#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, a[100];
  double average = 0;
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> a[i];
    average += a[i];
  }
  average /= n;
  double distance = 114514, comp;
  int ans;
  for (int i = 0; i < n; i++) {
    if (distance > (comp = abs(a[i] - average))) {
      distance = comp;
      ans = i;
    }
  }
  cout << ans << endl;
}
