#include <iostream>
#include <algorithm>

using namespace std;

int a[101];

int main(){
  int i,N,S=0,mini=100;
  cin >> N;
  for (i=0;i<N;++i) {
    cin >> a[i];
    S+=a[i];
    a[i]*=N;
  }
  a[100]=10000;
  for (i=0;i<N;++i) {
    a[i]=abs(S-a[i]);
    if (a[i]< a[mini]) {
      mini=i;
    }
  }
  cout << mini << endl;
  return 0;
}
