#include <bits/stdc++.h>
int main() {
  int n;
  int a[105];
  int ans = 0;
  int avg;
  int sum = 0;
  int i;
  scanf("%d", &n);
  for (i = 0; i < n; i++) {
    scanf("%d", &a[i]);
    a[i] *= 100;
    sum += a[i];
  }
  avg = sum / n;
  for (i = 1; i < n; i++) {
    if (abs(avg - a[ans]) > abs(avg - a[i])) {
      ans = i;
    }
  }
  printf("%d\n", ans);
  return 0;
}
