a=int(input())
b = [int(i) for i in input().split()]
#print(b)
#print(sum(b)/a)
c={}
for i in range(3):
	c.update({abs(sum(b)/a-b[i]):i})
#print(c)
c = sorted(c.items())
if len(c)==1:
	print(0)
else:
	print(c[0][1])
