#include<bits/stdc++.h>
using namespace std;
const int N=105;
int n,a[N],nans;double av,aa;
int main(){
    ios::sync_with_stdio(false);cin>>n;
    for(int i=1;i<=n;++i)cin>>a[i],av+=a[i];av/=n;
    aa=0x3f3f3f3f;
    for(int i=1;i<=n;++i)if(aa>fabs(av-a[i]))aa=fabs(av-a[i]),nans=i;
    cout<<nans-1<<endl;return 0;
}