import numpy as np
N = int(input())
list = list(map(int,input().split()))
mean = int(np.mean(list))

# print(mean)
minabs = 1000
min = 0
for i,data in enumerate(list):
    if abs(data - mean) < minabs:
        minabs = abs(data - mean)
        min = i

print(min)