object Main{
	def main(args:Array[String]){
		val s = new java.util.Scanner(System.in)

		val a=Array.fill(5)(s.nextInt).sortBy(i=>(i+9)%10)

		for(i<-1 to 4)
			a(i)=(a(i) + 9) / 10 * 10

		println(a.sum)
	}
}