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