#include <bits/stdc++.h>
using namespace std;
int arr[100];
int main() {
  int N;
  scanf("%d", &N);
  int sum = 0;
  for (int i = 0; i < N; ++i) {
    scanf("%d", &arr[i]);
    sum += arr[i];
  }
  int ave = sum / N;
  int diff = 12345;
  int idx = 0;
  for (int i = 0; i < N; ++i) {
    if (abs(ave - arr[i]) < diff) {
      idx = i;
      diff = abs(ave - arr[i]);
    }
    if (diff == 0) {
      break;
    }
  }
  printf("%d\n", idx);
  return 0;
}
