function myOut(text){console.log(text);}//standard output
function Main(input) {
	input = input.trim();
	//input = input.split(" ");
	//input = input.split("\n");
	//input = input.split(" ").map((a)=>Number(a));
	input = input.split("\n").map((a)=>Number(a));
  input.sort(function(a,b){
  	return b % 10 - a % 10;
  });
  var zero = [];
  var output = 0;
  
  for(var i = 0; i < input.length; i++){
    if(input[i] % 10 == 0){
       zero.push(input[i]);
      input.splice(i,1);
      i--;
       }
  }
  
  var last = 0;
  if(input.length != 0){
  	last = input[input.length - 1];
     }
  
  for(var i = 0; i < input.length - 1; i++){
    output += input[i] + (10 - input[i] % 10);
  }
  for(var i = 0; i < zero.length; i++){
    output += zero[i];
  }
  
  //myOut(output);
  myOut(output + last);
}

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