n = gets.to_i if (n == 0) then p 101 end a = gets.split.map(&:to_i) sum_v = a.sum() #p sum_v cnt1 = 0 101.times do |ak| if ((ak + sum_v) % n == 0) then cnt1 += 1 end end p cnt1