import sys
def input(): return sys.stdin.readline().rstrip()
def main():
    n=int(input())
    A=[int(_) for _ in input().split()]
    ave = sum(A)/n
    A.sort()
    d=abs(A[0]-ave)
    for i,a in enumerate(A[1:]):
        if abs(a-ave)<d:
            d=abs(a-ave)
        else:
            print(i)
            break

if __name__=='__main__':
    main()