n = int(input())
a = list(map(int,input().split()))
l = []
ave = sum(a)/n

diff = 1000
res = 0

for i in range(len(a)):
    if diff > abs(ave-a[i]):
        res = i
        diff = ave-a[i]
else:
    print(res)
