fun main(args:Array<String>) {
    val abcde = (1..5).map { readLine()!!.toInt() }
    var total = abcde.map { if(it%10==0) it else it + (10 - it%10) }.sum()
    total -= 10 - (abcde.map { it % 10 }.filter { it > 0 }.min()?:0)
    println(total)
}
