from statistics import mean
N = int(input())
a=list(map(int,input().split(' ')))

avg=mean(a)

b=[]
for i in range(N):
    b.append(abs(a[i]-avg) )

#print(min(b))
c=sorted(b)

for i in range(N):
    if c[i]==min(b):
        print(i)
        exit(0)
