N=int(input())
a=list(map(int,input().split()))
sum=0
for i in range(N):
    sum+=a[i]
ave=sum/N
ans=-1
min=100
for i in range(N):
    if min > abs(a[i]-ave):
        ans=i
        min=abs(a[i]-ave)
print(str(ans))