n = int(raw_input())
nums = map(float, raw_input().split())
sum = 0.0
for i in xrange(n):
	sum += nums[i]
avg = sum / float(n)
ans, idx = 10000.0, 0
for i in xrange(n):
	if abs(avg-nums[i]) < ans:
		ans = abs(avg-nums[i])
		idx = i
print idx 
