fun main(args: Array<String>) {
	val input = IntArray(5) { (readLine() ?: return).toInt() }
	val sort = input.map { it % 10 }.filter { it > 0 }.sorted()
	if (sort.size == 0) {
		println(input.sum())
		return
	}
	println(input.map { if (it % 10 == 0) it else (it / 10 + 1) * 10 }.sum() - 10 + sort[0])
}