n = int(input())
a_l = list(map(int, input().split()))
import numpy as np
ave_a = np.mean(a_l)
a_l2 = [  abs(a-ave_a) for a in a_l]
ans = 0
l = a_l2[0]
for idx, i in enumerate(a_l2[1:]):
    if l > i:
        ans = min(idx+1, ans)
print(ans)