#include <bits/stdc++.h>
int main(void) {
  int n = 0;
  int hure[101];
  int hure_heikin = 0;
  int hure_sa[101];
  int ans;
  scanf("%d", &n);
  ;
  for (int i = 0; i < n; i++) {
    scanf("%d", &hure[i]);
    hure_heikin += hure[i];
  }
  for (int j = 0; j < n; j++) {
    if (hure[j] * n - hure_heikin > 0) {
      hure_sa[j] = hure[j] * n - hure_heikin;
    }
    if (hure[j] * n - hure_heikin < 0) {
      hure_sa[j] = (hure[j] * n - hure_heikin) * -1;
    }
    if (j == 0) {
      ans = hure_sa[0];
    }
    if (hure_sa[j] < ans) {
      ans = j;
    }
  }
  printf("%d\n", ans);
}
