#include <iostream>

using namespace std;


int main()
{
  int N;
  double a[101];
  double ave = 0;
  int ans=0;
  cin >> N;
  for (int i = 0; i < N; i++) {
    cin >> a[i];
    ave += a[i];
  }
  ave /= N;
  for(int i = 1; i < N; i++)
    {
      if(max(a[i] - ave, ave - a[i]) < max(a[ans] -ave, ave - a[ans]) )
	{
	  ans = i;
	}
    }
  cout << ans << endl;
  return 0;
}
