fun main(args:Array<String>) {
    val abcde = (1..5).map { readLine()!!.toInt() }
    val fix = abcde.map { ((it + 9)/10)*10 }
    val ans = fix.sum() - abcde.indices.map { fix[it] - abcde[it] }.max()!!
    println(ans)
}
