#include <bits/stdc++.h>
using namespace std;
int main(){
  long long n,ans;
  cin >> n;
  long long a[n];
  double ave,mindis=10000;
  for(int i=0;i<n;i++){
    cin >> a[i];
    ave+=a[i];
  }
  ave/=(double)n;
  for(int i=0;i<n;i++){
    if(mindis>abs(ave-(double)a[i])){
      mindis=abs(ave-(double)a[i]);
      ans=i;
    }
  }
  cout << ans << endl;
  return 0;
}
