#include <stdio.H>

int main(void)
{
	int i,a[5];
	int time = 0;
	
	for(i = 0, i < 5; i++){
		scanf("%d",&a[i]);
	}
	
	
	
	//計算部分
	
	for(i = 0, i < 5; i++){
		if(a[i] % 10 == 0){
			time = time + a[i];
		}else{
			int hosuu = 10 - a[i]%10;
			
			time = time + a[i] + hosuu;
		}
	}
	
	printf("%d",time);
	
	return 0;
}
	
	