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