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