gets cs = gets.split.map(&:to_i) border = cs.inject(&:+) / 10.0 puts 30 * cs.reject{|c| c > border}.size