from bisect import bisect_left
N = int(input())
a = sorted(list(map(int, input().split())))
Ave = sum(a) / N
tmp = float("inf")
for i in range(N):
	if abs(a[i] - Ave) < tmp:
		tmp = abs(a[i] - Ave)
		ans = i
print(ans)
