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

int main() {
  int n;
  vector<int> a(n);
  double sum=0;
  for ( int i=0; i<n; i++ ) cin >> a[i];
  for ( int i=0; i<n; i++ ) sum += a[i];
  sum/=n;
  int id=0, dist=100;
  for ( int i=0; i<n; i++ ) if ( fabs(sum-a[i])<dist ) { id=i; dist=fabs(sum-a[i]); }
  cout << id << '\n';
  return 0;
}