import math
n = int(raw_input())
a =  raw_input().split()
a = map(int, a)
ave = float(sum(a))/n
dif = 10000
count  = 0
ans = 0
for x in a:
    s = abs(x-ave)
    if s < dif:
        dif = s
        ans = count
    count += 1
  
print("%d" % ans)