import java.io.InputStream;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.Scanner;

public class Main { 
	public static void main(String[] args) {
		
		InputStream input = System.in;
		Scanner in = new Scanner(input);
		int[] allInt = new int[5];
		for(int i = 0;i<5;i++) {
			allInt[i] = Integer.parseInt(in.next());
		}
		int[] total = new int[5];
		
		for(int i = 0;i<5;i++) {
			total[i] = 0;
			for(int j = 0;j<5;j++) {
				
				if(i == j) {
					total[i] += allInt[j];
				}else {
					total[i] += allInt[j]/10*10;
					int tmp = allInt[j]%10 == 0 ? 0 : 10;
					total[i] += tmp;
				}
				
			}
			
		}
		Arrays.sort(total);
		
		System.out.println(total[0]);
		
		
	}
}
	
	
/tmp/hf-datasets-cache/medium/datasets/42704881117311-config-parquet-and-info-qiankunmu-Project_CodeNet-896c9d36/hub/datasets--qiankunmu--Project_CodeNet_Python800_and_Java250/snapshots/c899fde44a77ba1cc14973ed3de064e4ff3aadc7/Project_CodeNet_Java250.tar.gz