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 -= abcde.map { it % 10 }.filter { it > 0 }.map { 10-it }.max()!!
    println(total)
}
