n = gets.chomp.to_i c = gets.chomp.split(" ").map(&:to_i) a = c.inject(:+) / 10 res = 0 c.each do |cc| if cc <= a then res += 1 end end p res * 30