#include <bits/stdc++.h>
using namespace std;
int main() {
  int i, n, a[100];
  float sum, avr;
  scanf("%d", &n);
  sum = 0;
  for (i = 0; i < n; i++) {
    scanf("%d", a + i);
    sum += a[i];
  }
  avr = sum / n;
  int ans = 0;
  float diff = fabsf(a[0] - avr);
  for (i = 1; i < n; i++) {
    if (fabsf(a[i] - avr) < diff) {
      ans = i;
    }
  }
  printf("%d\n", ans);
  return 0;
}
