#include <bits/stdc++.h>
using namespace std;
const long long mod = 1e9 + 7;
int main() {
  int N;
  cin >> N;
  int a[100];
  int tmp = 0;
  for (int i = 0; i < N; i++) {
    cin >> a[i];
    tmp += a[i];
  }
  tmp = tmp / N;
  int j = 10000000;
  for (int i = 0; i < N; i++) {
    int x = abs(a[i] - tmp);
    j = min(j, x);
  }
  int ans;
  for (int i = 0; i < N; i++) {
    int x = abs(a[i] - tmp);
    if (x == j) {
      ans = i;
      break;
    }
  }
  cout << ans << endl;
  return 0;
}
