n = int(raw_input())
arr = map(int,raw_input().split())
ave = sum(arr)*1.0/n
arr_d = []
min = 100
min_i = -1
for i in range(n):
    if abs(ave-arr[i])<min:
        min=abs(ave-arr[i])
        min_i = i
print min_i