function Main(input) {
    var menu = input.map(i => parseInt(i, 10));

    var kiriage = menu.map(m => {
        return Math.ceil(m/10) * 10;
    });
    var min = Math.min.apply(null, menu.map(m => m%10));

    var result = 0;

    for (var i = 0; i < kiriage.length; i++) {
        result += kiriage[i];
    }

    if (min !== 0) {
        result = result - 10 + min;
    }
    
    console.log(result);
}
 
Main(require("fs").readFileSync("/dev/stdin", "utf8").trim().split(/\n|\s/));