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