#include <bits/stdc++.h>
long long inf = 1000000000;
using namespace std;
long long gcd(long long x, long long y) {
  if (y == 0) return x;
  return gcd(y, x % y);
}
long long lcm(long long x, long long y) { return x / gcd(x, y) * y; }
long long Max(long long x, long long y) {
  if (x > y)
    return x;
  else
    return y;
}
long long Min(long long x, long long y) {
  if (x < y)
    return x;
  else
    return y;
}
long long kai(long long x) {
  long long cnt = 1;
  if (x == 0) return 1;
  cnt = kai(x - 1);
  return x * cnt;
}
long long prime(long long n) {
  for (long long i = 2; i * i <= n; i++) {
    if (n % i == 0) return false;
  }
  return n != 1;
}
long long kiyaku(long long n) {
  long long ans = n;
  for (long long i = 2; i <= n; i++) {
    if (prime(i)) {
      if (n % i == 0) {
        ans /= i;
        ans *= (i - 1);
      }
    }
  }
  return ans;
}
long long n, a[105], hei, ans = 1000000, memo[105];
signed main() {
  cin >> n;
  long long cnt = 0;
  for (long long i = 0; i < n; i++) {
    cin >> a[i];
    cnt += a[i];
  }
  hei = cnt / n;
  for (long long i = 0; i < n; i++) {
    memo[i] = abs(hei - a[i]);
    ans = Min(ans, memo[i]);
  }
  for (long long i = 0; i < n; i++) {
    if (ans == memo[i]) {
      cout << i << endl;
      return 0;
    }
  }
}
