a=gets.to_i b=gets.split(" ").map{|e| e.to_i}.sum ans=0 0.upto(100){|i| ans+=1 if (b+i)%a==0 } puts ans