#include <bits/stdc++.h>
using namespace std;
int n;
int a[100];
double ave;
int ans;
int mi;
int sum = 0;
int main() {
  scanf("%d", &n);
  mi = 101;
  for (int i = 0; i < n; i++) {
    scanf("%d", &a[i]);
    sum += a[i];
  }
  ave = sum * 1.0 / n;
  for (int i = 0; i < n; i++) {
    if (mi > abs(ave - a[i])) {
      mi = abs(ave - a[i]);
      ans = i;
    }
  }
  printf("%d\n", ans);
  return 0;
}
