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

    var kiriage = menu.map(m => {
        return Math.ceil(m/10) * 10;
    });

    var min = 0;

    if (menu.filter(m => m % 10 !== 0).length !== 0) {
        var notzero = menu.filter(nz => nz % 10 !== 0);
        min = Math.min.apply(null, notzero);
    }

    var result = 0;

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

    if (min !== 0) {
        if (Math.min.apply(null, menu) < 10) {
            result = result + min;
        } else {
            result = result - 10 + min;
        }
    } else {
        result += 10;
    }

    console.log(result);
}
 
Main(require("fs").readFileSync("/dev/stdin", "utf8").trim().split(/\n|\s/));