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