array = STDIN.each_line.map(&:chomp).map(&:to_i)

array.sort!{ |a, b| (a % 10 <=> b % 10) }

array.each_with_index { |i, index|
                        if i % 10 == 0 then
                          array.push(i)
                          array.delete_at(index)
                        end
                      }

sum = 0
array.each_with_index { |i, index|
                        if index == 0 then
                          sum += i
                        else
                          sum += i.ceil(-1)
                        end }

puts sum            