#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, i;
  cin >> n;
  float total = 0, a[n];
  for (i = 0; i < n; i++) {
    float k;
    cin >> k;
    a[i] = k;
    total += k;
  }
  float ave;
  ave = total / n;
  float min = 200, h;
  int flag;
  for (i = 0; i < n; i++) {
    h = a[i] - ave;
    if (h < 0) h = (-h);
    if (min > h) flag = i;
    min = h;
  }
  cout << flag << endl;
  return 0;
}
