N = int(input())
a = list(map(int, input().split()))
average = sum(a)//N
minv = 101
minframe = 0
for i in range(N):
    diff = abs(a[i] - average)
    if diff < minv:
        minv = diff
        minframe = i

print(minframe)