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