#include <bits/stdc++.h>
using namespace std;
inline long long read() {
  long long Hashimoto = 0;
  bool Kanna = 1;
  char I_Love = getchar();
  while (I_Love < '0' || I_Love > '9') {
    if (I_Love == '-') Kanna = 0;
    I_Love = getchar();
  }
  while (I_Love >= '0' && I_Love <= '9') {
    Hashimoto = Hashimoto * 10 + I_Love - '0';
    I_Love = getchar();
  }
  return (Kanna ? Hashimoto : -Hashimoto);
}
template <typename T1, typename T2>
inline void Umax(T1 &a, T2 b) {
  if (a < b) a = b;
}
template <typename T1, typename T2>
inline void Umin(T1 &a, T2 b) {
  if (a > b) a = b;
}
int n;
int a[111];
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  ;
  cin >> n;
  int sum = 0;
  for (int i = 0; i < (n); ++i) {
    cin >> a[i];
    a[i] *= 2;
    sum += a[i];
  }
  sum /= n;
  int pos = 0;
  for (int i = 1; i < (n); ++i) {
    if (abs(a[i] - sum) < abs(a[pos] - sum)) pos = i;
  }
  cout << pos << endl;
  ;
  return 0;
}
