#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, a[100];
  int sum = 0;
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> a[i];
  }
  for (int i = 0; i < n; i++) {
    sum = sum + a[i];
  }
  float avg = 0;
  avg = sum / n;
  float pre;
  int ans = 100;
  int wa;
  for (int i = 0; i < n; i++) {
    pre = a[i] - avg;
    if (pre < 0) pre = -pre;
    if (ans > pre) {
      ans = pre;
      wa = i;
    }
  }
  cout << wa << endl;
  return 0;
}
