n = gets.to_i a = gets.split(" ").map(&:to_i) count = 0 sum = 0 a.each{ |i| sum += i} 100.times do |num| count += 1 if (sum + num) % 5 == 0 end