#include <bits/stdc++.h>
using namespace std;
long long n, a[100];
double sum, absmin = 9223372036854775807;
signed main() {
  cin >> n;
  for (long long i = 0; i < (long long)(n); ++i) cin >> a[i], sum += a[i];
  sum /= n;
  for (long long i = 0; i < (long long)(n); ++i)
    absmin = min(absmin, abs(a[i] - sum));
  for (long long i = 0; i < (long long)(n); ++i)
    if (absmin + a[i] == sum || absmin - a[i] == sum) {
      cout << i << endl;
      return 0;
    }
}
