#include <bits/stdc++.h>
using namespace std;
const int maxn = 1e5 + 10;
int a[110];
int main() {
  int n;
  scanf("%d", &n);
  int sum = 0;
  for (int i = 0; i < n; i++) {
    scanf("%d", &a[i]);
    sum += a[i];
  }
  double aver = sum * 1.0 / n;
  int res;
  int flag = 1e9;
  for (int i = 0; i < n; i++) {
    if (abs(aver - a[i]) < flag) {
      flag = abs(aver - a[i]);
      res = i;
    }
  }
  printf("%d\n", res);
}
