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