#include <bits/stdc++.h>
using namespace std;

int n;
double a[105] = {0};
double ave = 0;
int ans = 0;

int main() {
  cin >> n;
  for(int i = 0; i < n; ++i) {
    cin >> a[i];
    ave += a[i];
  }
  ave /= (double)n;
  ans = 0;
  for(int i = 0; i < n; ++i)
    if(fabs(ave - a[ans]) > fabs(ave - a[i])) ans = i;
  cout << ans << endl;
  return 0;
}