import java.util.*;
 
public class Main {
	
    public static void main(String[] args) {
    	Scanner sc = new Scanner(System.in);
    	int[] fra = {sc.nextInt(),sc.nextInt(),sc.nextInt(),sc.nextInt(),sc.nextInt()};
    	int minFra = Integer.MAX_VALUE;
    	int order = 0;
    	for (int i = 0; i < fra.length; i++) {
    		if (0 < fra[i]%10 && fra[i]%10 < minFra) {
    			minFra = fra[i]%10;
    			order = i;
    		}
    	}
    	int count = 0;
    	for (int i = 0; i < fra.length; i++) {
    		if (i != order && 0 < fra[i]%10) {
    			count += fra[i] + 10 - fra[i]%10;
    		} else {
    			count += fra[i];
    		}
    	}
    	System.out.println(count);
    }
} import java.util.*; util.* java public class Main {
	
    public static void main(String[] args) {
    	Scanner sc = new Scanner(System.in);
    	int[] fra = {sc.nextInt(),sc.nextInt(),sc.nextInt(),sc.nextInt(),sc.nextInt()};
    	int minFra = Integer.MAX_VALUE;
    	int order = 0;
    	for (int i = 0; i < fra.length; i++) {
    		if (0 < fra[i]%10 && fra[i]%10 < minFra) {
    			minFra = fra[i]%10;
    			order = i;
    		}
    	}
    	int count = 0;
    	for (int i = 0; i < fra.length; i++) {
    		if (i != order && 0 < fra[i]%10) {
    			count += fra[i] + 10 - fra[i]%10;
    		} else {
    			count += fra[i];
    		}
    	}
    	System.out.println(count);
    }
} Main public static void main(String[] args) {
    	Scanner sc = new Scanner(System.in);
    	int[] fra = {sc.nextInt(),sc.nextInt(),sc.nextInt(),sc.nextInt(),sc.nextInt()};
    	int minFra = Integer.MAX_VALUE;
    	int order = 0;
    	for (int i = 0; i < fra.length; i++) {
    		if (0 < fra[i]%10 && fra[i]%10 < minFra) {
    			minFra = fra[i]%10;
    			order = i;
    		}
    	}
    	int count = 0;
    	for (int i = 0; i < fra.length; i++) {
    		if (i != order && 0 < fra[i]%10) {
    			count += fra[i] + 10 - fra[i]%10;
    		} else {
    			count += fra[i];
    		}
    	}
    	System.out.println(count);
    } main {
    	Scanner sc = new Scanner(System.in);
    	int[] fra = {sc.nextInt(),sc.nextInt(),sc.nextInt(),sc.nextInt(),sc.nextInt()};
    	int minFra = Integer.MAX_VALUE;
    	int order = 0;
    	for (int i = 0; i < fra.length; i++) {
    		if (0 < fra[i]%10 && fra[i]%10 < minFra) {
    			minFra = fra[i]%10;
    			order = i;
    		}
    	}
    	int count = 0;
    	for (int i = 0; i < fra.length; i++) {
    		if (i != order && 0 < fra[i]%10) {
    			count += fra[i] + 10 - fra[i]%10;
    		} else {
    			count += fra[i];
    		}
    	}
    	System.out.println(count);
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int[] fra = {sc.nextInt(),sc.nextInt(),sc.nextInt(),sc.nextInt(),sc.nextInt()}; fra {sc.nextInt(),sc.nextInt(),sc.nextInt(),sc.nextInt(),sc.nextInt()} sc.nextInt() sc.nextInt sc sc.nextInt() sc.nextInt sc sc.nextInt() sc.nextInt sc sc.nextInt() sc.nextInt sc sc.nextInt() sc.nextInt sc int minFra = Integer.MAX_VALUE; minFra Integer.MAX_VALUE Integer Integer.MAX_VALUE int order = 0; order 0 for (int i = 0; i < fra.length; i++) {
    		if (0 < fra[i]%10 && fra[i]%10 < minFra) {
    			minFra = fra[i]%10;
    			order = i;
    		}
    	} int i = 0; int i = 0; i 0 i < fra.length i fra.length fra fra.length i++ i++ i {
    		if (0 < fra[i]%10 && fra[i]%10 < minFra) {
    			minFra = fra[i]%10;
    			order = i;
    		}
    	} {
    		if (0 < fra[i]%10 && fra[i]%10 < minFra) {
    			minFra = fra[i]%10;
    			order = i;
    		}
    	} if (0 < fra[i]%10 && fra[i]%10 < minFra) {
    			minFra = fra[i]%10;
    			order = i;
    		} 0 < fra[i]%10 && fra[i]%10 < minFra 0 < fra[i]%10 0 fra[i]%10 fra[i] fra i 10 fra[i]%10 < minFra fra[i]%10 fra[i] fra i 10 minFra {
    			minFra = fra[i]%10;
    			order = i;
    		} minFra = fra[i]%10 minFra fra[i]%10 fra[i] fra i 10 order = i order i int count = 0; count 0 for (int i = 0; i < fra.length; i++) {
    		if (i != order && 0 < fra[i]%10) {
    			count += fra[i] + 10 - fra[i]%10;
    		} else {
    			count += fra[i];
    		}
    	} int i = 0; int i = 0; i 0 i < fra.length i fra.length fra fra.length i++ i++ i {
    		if (i != order && 0 < fra[i]%10) {
    			count += fra[i] + 10 - fra[i]%10;
    		} else {
    			count += fra[i];
    		}
    	} {
    		if (i != order && 0 < fra[i]%10) {
    			count += fra[i] + 10 - fra[i]%10;
    		} else {
    			count += fra[i];
    		}
    	} if (i != order && 0 < fra[i]%10) {
    			count += fra[i] + 10 - fra[i]%10;
    		} else {
    			count += fra[i];
    		} i != order && 0 < fra[i]%10 i != order i order 0 < fra[i]%10 0 fra[i]%10 fra[i] fra i 10 {
    			count += fra[i] + 10 - fra[i]%10;
    		} count += fra[i] + 10 - fra[i]%10 count fra[i] + 10 - fra[i]%10 fra[i] + 10 fra[i] fra i 10 fra[i]%10 fra[i] fra i 10 {
    			count += fra[i];
    		} count += fra[i] count fra[i] fra i System.out.println(count) System.out.println System.out System System.out count String[] args args public class Main {
	
    public static void main(String[] args) {
    	Scanner sc = new Scanner(System.in);
    	int[] fra = {sc.nextInt(),sc.nextInt(),sc.nextInt(),sc.nextInt(),sc.nextInt()};
    	int minFra = Integer.MAX_VALUE;
    	int order = 0;
    	for (int i = 0; i < fra.length; i++) {
    		if (0 < fra[i]%10 && fra[i]%10 < minFra) {
    			minFra = fra[i]%10;
    			order = i;
    		}
    	}
    	int count = 0;
    	for (int i = 0; i < fra.length; i++) {
    		if (i != order && 0 < fra[i]%10) {
    			count += fra[i] + 10 - fra[i]%10;
    		} else {
    			count += fra[i];
    		}
    	}
    	System.out.println(count);
    }
} public class Main {
	
    public static void main(String[] args) {
    	Scanner sc = new Scanner(System.in);
    	int[] fra = {sc.nextInt(),sc.nextInt(),sc.nextInt(),sc.nextInt(),sc.nextInt()};
    	int minFra = Integer.MAX_VALUE;
    	int order = 0;
    	for (int i = 0; i < fra.length; i++) {
    		if (0 < fra[i]%10 && fra[i]%10 < minFra) {
    			minFra = fra[i]%10;
    			order = i;
    		}
    	}
    	int count = 0;
    	for (int i = 0; i < fra.length; i++) {
    		if (i != order && 0 < fra[i]%10) {
    			count += fra[i] + 10 - fra[i]%10;
    		} else {
    			count += fra[i];
    		}
    	}
    	System.out.println(count);
    }
} Main
import java.util.*;
 
public class Main {
	
    public static void main(String[] args) {
    	Scanner sc = new Scanner(System.in);
    	int[] fra = {sc.nextInt(),sc.nextInt(),sc.nextInt(),sc.nextInt(),sc.nextInt()};
    	int minFra = Integer.MAX_VALUE;
    	int order = 0;
    	for (int i = 0; i < fra.length; i++) {
    		if (0 < fra[i]%10 && fra[i]%10 < minFra) {
    			minFra = fra[i]%10;
    			order = i;
    		}
    	}
    	int count = 0;
    	for (int i = 0; i < fra.length; i++) {
    		if (i != order && 0 < fra[i]%10) {
    			count += fra[i] + 10 - fra[i]%10;
    		} else {
    			count += fra[i];
    		}
    	}
    	System.out.println(count);
    }
}