fun main(args: Array<String>) {
    val l = (0..4).map{ readLine()!!.toInt()}
    var ll = l.map{ it % 10}.sorted().filter { it != 0 }
    var x = 0
    l.map{
        x +=
                if (it % 10 == 0) it
                else (it / 10 + 1) * 10
        println(x)
    }
    println(x + ll[0] - 10)
}