function Main (input) {
  input = input.split("\n");
  if(input[input.length - 1] === "") 
  {
    input.pop();
  }
  var min = 10;
  var total = 0;
  for(var i = 0; i < input.length; i++) {
    var r = input[i] % 10;
    if(r > 0 && r < min){
      min = r;
    }
    total += (Math.ceil(input[i] /10) * 10);
  }
  if ( min < 10) {
    total = total - 10 + min;
  }
  console.log(total);
}

Main(require("fs").readFileSync("/dev/stdin", "utf8"));
