N = int(input())
data = list(map(int, input().split()))
ave = sum(data) / len(data)
thumbnail_num = 1000
for i in range(len(data)):
  if abs(data[i] - ave) < thumbnail_num:
    thumbnail_num = i

print(thumbnail_num)
