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