#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, k;
  int arr[200];
  cin >> n;
  double total = 0, avg = 0;
  for (int i = 0; i < n; i++) {
    cin >> arr[i];
    total += arr[i];
  }
  avg = total / n;
  int min = 200;
  double ming = 100;
  for (int i = 0; i < n; i++) {
    if (abs(arr[i] - avg) < ming) {
      ming = abs(arr[i] - avg);
      min = i;
    }
  }
  cout << min << endl;
  return 0;
}
