#include <bits/stdc++.h>
using namespace std;
const long long INF = 0x3f3f3f3f3f3f;
const int P = 1e9 + 7;
const int MAXN = 32000;
const double pi = 3.1415926;
const long long mod = 1000000007;
struct qwq {
  int id;
  double num;
} st[101];
bool cmp1(qwq a, qwq b) {
  if (a.num == b.num)
    return a.id < b.id;
  else {
    return a.num < b.num;
  }
}
int n;
int main() {
  double sum = 0;
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> st[i].num;
    st[i].id = i;
    sum += st[i].num;
  }
  double dis = sum;
  int k;
  sum /= n;
  sort(st, st + n, cmp1);
  for (int i = 0; i < n; i++) {
    if (fabs(st[i].num - sum) < dis) {
      dis = fabs(st[i].num - sum);
      k = i;
    }
  }
  cout << k;
  return 0;
}
