n=int(input()) a=list(map(int,input().split())) if n>20: raise Exception def popcount(n): return bin(n).count('1') ans=0 for bit in range(1<>i)&1: b.append(a[i]) mx=max(b) if sum(b)%(k-1)==0 and mx<=sum(b)//(k-1): ans+=1 print(ans)