class Calc0191 def initialize(args) args = args.map { |l| l.chomp.split(/\s+/) } @n = args.shift.first.to_i @cs = args.shift.map(&:to_i) end def run s = @cs.inject(:+) / 10 @cs.count { |c| c <= s } * 30 end end puts Calc0191.new(STDIN.readlines).run if __FILE__ == $0