fun main(args: Array<String>) {
    val array = Array(5) {
        readLine()!!.toInt()
    }
    val round = { it: Int -> (10 - it % 10) % 10 }
    var ans = array.sumBy { it + round(it) } - array.map { round(it) }.max()!!
    println(ans)
}