import sys
def input(): return sys.stdin.readline().strip()

def resolve():
    n=int(input())
    l=list(map(int,input().split()))
    heikin=sum(l)//n
    samunenum=100
    samune=10**18
    for i in range(n):
        x=abs(heikin-l[i])
        if x<samune:
            samunenum=i
            samune=x
    print(samunenum)
resolve()