n = int(input()) if n > 1: ls = map(int,input().split()) s = sum(ls) else: s = 0 c = 0 for i in range(101): if s+i == ((s+i)//n)*n: c += 1 print(c)