#include <iostream>
using namespace std;

int main(){
	int sum, x, last;
	last = 10;
	sum = 0;
	for(int i=0; i<5; i++){
		cin >> x;
		if(x%10 != 0){
			last = min(last, x%10);
		}
		x = ((x+9)/10)*10;
		sum += x;
	}
	cout << sum-(10-last) << endl;
	return 0;
}