fun main (args: Array<String>) {
  val n = readLine()!!.split("\n").map(String::toInt)
  var sum: Int = 0
  var r = 0
  for (v in n){
    if (v % 10 == 0){
      sum = sum + v
    } else{
      sum = sum + (v / 10 + 1) * 10
      if (r < (10 - v % 10)) r = (10 - v % 10)
    }
  }
  println(sum - r)
}
