#include <bits/stdc++.h>
using namespace std;
const int MAX_N = 100 + 7;
int A[MAX_N];
int main() {
  int N;
  scanf("%d", &N);
  long long avg = 0;
  for (int i = 0; i < N; i++) {
    scanf("%d", &A[i]);
    A[i] *= 2;
    avg += A[i];
  }
  avg /= N;
  int ans = 0;
  for (int i = 1; i < N; i++) {
    if (abs(A[i] - avg) < abs(A[ans] - avg)) ans = i;
  }
  printf("%d\n", ans);
  return 0;
}
