#include <bits/stdc++.h>
using namespace std;
const long long MOD = 1e9 + 7;
int n, mn = 1e9, ans;
long double a[110], sum = 0;
int main() {
  cin >> n;
  for (int i = 0; i < n; i++) cin >> a[i], sum += a[i];
  sum /= (long double)n;
  for (int i = 0; i < n; i++) {
    long double tmp = abs(a[i] - sum);
    if (tmp < mn) {
      mn = tmp;
      ans = i;
    }
  }
  cout << ans << endl;
  return 0;
}
