from statistics import mean, median
input()
inputs =  list(map(int, input().split()))

med = median(inputs)
flameNum = 0
tmpnum = 0
min = 999
for i in inputs:
    if(abs(i - med) < min):
        min = abs(i-med)
        flameNum = tmpnum
    tmpnum += 1
print(flameNum)