#include <bits/stdc++.h>
using namespace std;
int main() {
  int a[100];
  int n;
  cin >> n;
  int sum = 0;
  int s = 1000000;
  int id = -1;
  for (int i = 0; i < n; i++) {
    cin >> a[i];
  }
  for (int i = 0; i < n; i++) {
    sum += a[i];
  }
  sum = sum / n;
  for (int i = 0; i < 100; i++) {
    if (s > abs(sum - a[i])) {
      id = i;
      s = abs(sum - a[i]);
    }
  }
  cout << id << endl;
}
