fun main(args: Array<String>) = yorukatsu20a()

fun yorukatsu20a() {
    val list = (1..5).map { readLine()!!.toInt() }

    val minBy = list.filterNot { it % 10 == 0 }.minBy { it % 10 } ?: 0
    val answer = (list - minBy).map { ((it + 9) / 10) * 10 }.sum() + minBy

    println(answer)
}
