fun abc123b(args: Array<String>) {
    val numList = args.map { it.toInt() }
    val total = numList.map { if (it % 10 == 0) it / 10 * 10 else (it + 10) / 10 * 10 }.sum()
    val lastDiff = 10 - numList.map { if (it % 10 == 0) 10 else it % 10 }.min()!!
    println(total - lastDiff)
}

fun main(args: Array<String>) {
    abc123b(readLineList())
}

fun readLineList(): Array<String> {
    val lineList = mutableListOf<String>()
    while (true) {
        val line = readLine()
        if (line.isNullOrBlank()) {
            break
        } else {
            lineList.add(line!!)
        }
    }
    return lineList.toTypedArray()
}