#include <bits/stdc++.h>
int main(void) {
  int i, n, ans;
  double a[n], sum = 0, min = 101.0;
  scanf("%d", &n);
  for (i = 0; i < n; i++) {
    scanf("%f", &a[i]);
    sum += a[i];
  }
  double ave = sum / (double)n;
  for (i = 0; i < n; i++) {
    if (abs(a[i] - ave) < min) {
      if (abs(a[i] - ave) == 0) {
        ans = i;
        break;
      } else {
        ans = i;
        min = abs(a[i] - ave);
      }
    }
  }
  printf("%d", ans);
}
