import java.util.*;
public class Main {
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
        int[] time = new int[5];
      	for(int i = 0; i < 5; i++){
        	time[i] = sc.nextInt();
		}
      	int[] dt = new int[5];
        for(int i = 0; i < 5; i++){
        	if(time[i] % 10 == 0){
            	dt[i] = time[i];
            }else{
            	dt[i] = (time[i] / 10) * 10 + 10;
            }
        }
        
        int max = 0;
        int total = 0;
        for(int i = 0; i < 5; i++){
        	if(dt[i] - time[i] > max){
            	max = dt[i] - time[i];
            }
            total += dt[i];
        }
        System.out.println(total - max);
     }
} import java.util.*; util.* java public class Main {
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
        int[] time = new int[5];
      	for(int i = 0; i < 5; i++){
        	time[i] = sc.nextInt();
		}
      	int[] dt = new int[5];
        for(int i = 0; i < 5; i++){
        	if(time[i] % 10 == 0){
            	dt[i] = time[i];
            }else{
            	dt[i] = (time[i] / 10) * 10 + 10;
            }
        }
        
        int max = 0;
        int total = 0;
        for(int i = 0; i < 5; i++){
        	if(dt[i] - time[i] > max){
            	max = dt[i] - time[i];
            }
            total += dt[i];
        }
        System.out.println(total - max);
     }
} Main public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
        int[] time = new int[5];
      	for(int i = 0; i < 5; i++){
        	time[i] = sc.nextInt();
		}
      	int[] dt = new int[5];
        for(int i = 0; i < 5; i++){
        	if(time[i] % 10 == 0){
            	dt[i] = time[i];
            }else{
            	dt[i] = (time[i] / 10) * 10 + 10;
            }
        }
        
        int max = 0;
        int total = 0;
        for(int i = 0; i < 5; i++){
        	if(dt[i] - time[i] > max){
            	max = dt[i] - time[i];
            }
            total += dt[i];
        }
        System.out.println(total - max);
     } main {
		Scanner sc = new Scanner(System.in);
        int[] time = new int[5];
      	for(int i = 0; i < 5; i++){
        	time[i] = sc.nextInt();
		}
      	int[] dt = new int[5];
        for(int i = 0; i < 5; i++){
        	if(time[i] % 10 == 0){
            	dt[i] = time[i];
            }else{
            	dt[i] = (time[i] / 10) * 10 + 10;
            }
        }
        
        int max = 0;
        int total = 0;
        for(int i = 0; i < 5; i++){
        	if(dt[i] - time[i] > max){
            	max = dt[i] - time[i];
            }
            total += dt[i];
        }
        System.out.println(total - max);
     } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int[] time = new int[5]; time new int[5] 5 for(int i = 0; i < 5; i++){
        	time[i] = sc.nextInt();
		} int i = 0; int i = 0; i 0 i < 5 i 5 i++ i++ i {
        	time[i] = sc.nextInt();
		} {
        	time[i] = sc.nextInt();
		} time[i] = sc.nextInt() time[i] time i sc.nextInt() sc.nextInt sc int[] dt = new int[5]; dt new int[5] 5 for(int i = 0; i < 5; i++){
        	if(time[i] % 10 == 0){
            	dt[i] = time[i];
            }else{
            	dt[i] = (time[i] / 10) * 10 + 10;
            }
        } int i = 0; int i = 0; i 0 i < 5 i 5 i++ i++ i {
        	if(time[i] % 10 == 0){
            	dt[i] = time[i];
            }else{
            	dt[i] = (time[i] / 10) * 10 + 10;
            }
        } {
        	if(time[i] % 10 == 0){
            	dt[i] = time[i];
            }else{
            	dt[i] = (time[i] / 10) * 10 + 10;
            }
        } if(time[i] % 10 == 0){
            	dt[i] = time[i];
            }else{
            	dt[i] = (time[i] / 10) * 10 + 10;
            } time[i] % 10 == 0 time[i] % 10 time[i] time i 10 0 {
            	dt[i] = time[i];
            } dt[i] = time[i] dt[i] dt i time[i] time i {
            	dt[i] = (time[i] / 10) * 10 + 10;
            } dt[i] = (time[i] / 10) * 10 + 10 dt[i] dt i (time[i] / 10) * 10 + 10 (time[i] / 10) * 10 (time[i] / 10) time[i] time i 10 10 10 int max = 0; max 0 int total = 0; total 0 for(int i = 0; i < 5; i++){
        	if(dt[i] - time[i] > max){
            	max = dt[i] - time[i];
            }
            total += dt[i];
        } int i = 0; int i = 0; i 0 i < 5 i 5 i++ i++ i {
        	if(dt[i] - time[i] > max){
            	max = dt[i] - time[i];
            }
            total += dt[i];
        } {
        	if(dt[i] - time[i] > max){
            	max = dt[i] - time[i];
            }
            total += dt[i];
        } if(dt[i] - time[i] > max){
            	max = dt[i] - time[i];
            } dt[i] - time[i] > max dt[i] - time[i] dt[i] dt i time[i] time i max {
            	max = dt[i] - time[i];
            } max = dt[i] - time[i] max dt[i] - time[i] dt[i] dt i time[i] time i total += dt[i] total dt[i] dt i System.out.println(total - max) System.out.println System.out System System.out total - max total max String[] args args public class Main {
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
        int[] time = new int[5];
      	for(int i = 0; i < 5; i++){
        	time[i] = sc.nextInt();
		}
      	int[] dt = new int[5];
        for(int i = 0; i < 5; i++){
        	if(time[i] % 10 == 0){
            	dt[i] = time[i];
            }else{
            	dt[i] = (time[i] / 10) * 10 + 10;
            }
        }
        
        int max = 0;
        int total = 0;
        for(int i = 0; i < 5; i++){
        	if(dt[i] - time[i] > max){
            	max = dt[i] - time[i];
            }
            total += dt[i];
        }
        System.out.println(total - max);
     }
} public class Main {
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
        int[] time = new int[5];
      	for(int i = 0; i < 5; i++){
        	time[i] = sc.nextInt();
		}
      	int[] dt = new int[5];
        for(int i = 0; i < 5; i++){
        	if(time[i] % 10 == 0){
            	dt[i] = time[i];
            }else{
            	dt[i] = (time[i] / 10) * 10 + 10;
            }
        }
        
        int max = 0;
        int total = 0;
        for(int i = 0; i < 5; i++){
        	if(dt[i] - time[i] > max){
            	max = dt[i] - time[i];
            }
            total += dt[i];
        }
        System.out.println(total - max);
     }
} Main
import java.util.*;
public class Main {
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
        int[] time = new int[5];
      	for(int i = 0; i < 5; i++){
        	time[i] = sc.nextInt();
		}
      	int[] dt = new int[5];
        for(int i = 0; i < 5; i++){
        	if(time[i] % 10 == 0){
            	dt[i] = time[i];
            }else{
            	dt[i] = (time[i] / 10) * 10 + 10;
            }
        }
        
        int max = 0;
        int total = 0;
        for(int i = 0; i < 5; i++){
        	if(dt[i] - time[i] > max){
            	max = dt[i] - time[i];
            }
            total += dt[i];
        }
        System.out.println(total - max);
     }
}