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