N = int(input()) if N == 2: lsA = [int(input())] else: lsA = list(map(int,input().split())) sumA = sum(lsA) cnt = 0 for i in range(101): su = N*i a = su-sumA if 0 <= a <= 100: cnt += 1 print(cnt)