N = float(input())
a = list(map(float, input().split()))
aver = int(sum(a)//N+1) if sum(a)/N > sum(a)//N+0.5 else int(sum(a)//N)

inta = (0, -1, 1, -2, 2, -3, 3)

for atest in inta:
    if atest+aver in a:
        print(a.index(atest+aver))
        break