function main(input) {
	var list = input.split("\n");
	var time = 0;
	list = list.map((item) => {
		var min = +item%10 > 0 ? 10 * (parseInt(+item/10) + 1) : +item;
		return {
			chori  : +item,
			chumon : min,
			rug : min - +item
		};
	});
	list.sort((x, y) => {
		return x.rug - y.rug;
	});
	list.forEach((item, index) => {
		if(index === list.length - 1) {
			time += item.chori;
		} else {
			time += item.chumon;
		}
	});
	console.log(time);
}
main(require('fs').readFileSync('/dev/stdin', 'utf8'));