import java.util.*;
class Main{
	public static void main(String[] args){
    	Scanner scan = new Scanner(System.in);
      	int[] numbers = new int[5];
      	int lastdish = 0;
      	for(int i=0;i<5;i++){
        	numbers[i] = scan.nextInt();
        }
      	for(int i=0;i<5;i++){
        	if(numbers[i]%10 !=0 && resi(numbers[i]) < resi(numbers[lastdish])){
            	lastdish = i;
            }
        }
      	int time = 0;
      	for(int i = 0;i<5;i++){
        	if(i != lastdish){
            	time += kuriage(numbers[i]);
            }
        }
      	time+= numbers[lastdish];
        System.out.println(time);
    }
  	public static int resi(int n){
    	    int r=0;
          	if(n%10 == 0){
            	r = 10;
            } else {
            	r = n%10;
            }
      	return r;
    }
  	public static int kuriage(int n){
    	int a = 0;
      	if(n%10 == 0){
        	return n;
        } else {
        	return n + (10-n%10);
        }
    }
  
} import java.util.*; util.* java class Main{
	public static void main(String[] args){
    	Scanner scan = new Scanner(System.in);
      	int[] numbers = new int[5];
      	int lastdish = 0;
      	for(int i=0;i<5;i++){
        	numbers[i] = scan.nextInt();
        }
      	for(int i=0;i<5;i++){
        	if(numbers[i]%10 !=0 && resi(numbers[i]) < resi(numbers[lastdish])){
            	lastdish = i;
            }
        }
      	int time = 0;
      	for(int i = 0;i<5;i++){
        	if(i != lastdish){
            	time += kuriage(numbers[i]);
            }
        }
      	time+= numbers[lastdish];
        System.out.println(time);
    }
  	public static int resi(int n){
    	    int r=0;
          	if(n%10 == 0){
            	r = 10;
            } else {
            	r = n%10;
            }
      	return r;
    }
  	public static int kuriage(int n){
    	int a = 0;
      	if(n%10 == 0){
        	return n;
        } else {
        	return n + (10-n%10);
        }
    }
  
} Main public static void main(String[] args){
    	Scanner scan = new Scanner(System.in);
      	int[] numbers = new int[5];
      	int lastdish = 0;
      	for(int i=0;i<5;i++){
        	numbers[i] = scan.nextInt();
        }
      	for(int i=0;i<5;i++){
        	if(numbers[i]%10 !=0 && resi(numbers[i]) < resi(numbers[lastdish])){
            	lastdish = i;
            }
        }
      	int time = 0;
      	for(int i = 0;i<5;i++){
        	if(i != lastdish){
            	time += kuriage(numbers[i]);
            }
        }
      	time+= numbers[lastdish];
        System.out.println(time);
    } main {
    	Scanner scan = new Scanner(System.in);
      	int[] numbers = new int[5];
      	int lastdish = 0;
      	for(int i=0;i<5;i++){
        	numbers[i] = scan.nextInt();
        }
      	for(int i=0;i<5;i++){
        	if(numbers[i]%10 !=0 && resi(numbers[i]) < resi(numbers[lastdish])){
            	lastdish = i;
            }
        }
      	int time = 0;
      	for(int i = 0;i<5;i++){
        	if(i != lastdish){
            	time += kuriage(numbers[i]);
            }
        }
      	time+= numbers[lastdish];
        System.out.println(time);
    } Scanner scan = new Scanner(System.in); scan new Scanner(System.in) int[] numbers = new int[5]; numbers new int[5] 5 int lastdish = 0; lastdish 0 for(int i=0;i<5;i++){
        	numbers[i] = scan.nextInt();
        } int i=0; int i=0; i 0 i<5 i 5 i++ i++ i {
        	numbers[i] = scan.nextInt();
        } {
        	numbers[i] = scan.nextInt();
        } numbers[i] = scan.nextInt() numbers[i] numbers i scan.nextInt() scan.nextInt scan for(int i=0;i<5;i++){
        	if(numbers[i]%10 !=0 && resi(numbers[i]) < resi(numbers[lastdish])){
            	lastdish = i;
            }
        } int i=0; int i=0; i 0 i<5 i 5 i++ i++ i {
        	if(numbers[i]%10 !=0 && resi(numbers[i]) < resi(numbers[lastdish])){
            	lastdish = i;
            }
        } {
        	if(numbers[i]%10 !=0 && resi(numbers[i]) < resi(numbers[lastdish])){
            	lastdish = i;
            }
        } if(numbers[i]%10 !=0 && resi(numbers[i]) < resi(numbers[lastdish])){
            	lastdish = i;
            } numbers[i]%10 !=0 && resi(numbers[i]) < resi(numbers[lastdish]) numbers[i]%10 !=0 numbers[i]%10 numbers[i] numbers i 10 0 resi(numbers[i]) < resi(numbers[lastdish]) resi(numbers[i]) resi numbers[i] numbers i resi(numbers[lastdish]) resi numbers[lastdish] numbers lastdish {
            	lastdish = i;
            } lastdish = i lastdish i int time = 0; time 0 for(int i = 0;i<5;i++){
        	if(i != lastdish){
            	time += kuriage(numbers[i]);
            }
        } int i = 0; int i = 0; i 0 i<5 i 5 i++ i++ i {
        	if(i != lastdish){
            	time += kuriage(numbers[i]);
            }
        } {
        	if(i != lastdish){
            	time += kuriage(numbers[i]);
            }
        } if(i != lastdish){
            	time += kuriage(numbers[i]);
            } i != lastdish i lastdish {
            	time += kuriage(numbers[i]);
            } time += kuriage(numbers[i]) time kuriage(numbers[i]) kuriage numbers[i] numbers i time+= numbers[lastdish] time numbers[lastdish] numbers lastdish System.out.println(time) System.out.println System.out System System.out time String[] args args public static int resi(int n){
    	    int r=0;
          	if(n%10 == 0){
            	r = 10;
            } else {
            	r = n%10;
            }
      	return r;
    } resi {
    	    int r=0;
          	if(n%10 == 0){
            	r = 10;
            } else {
            	r = n%10;
            }
      	return r;
    } int r=0; r 0 if(n%10 == 0){
            	r = 10;
            } else {
            	r = n%10;
            } n%10 == 0 n%10 n 10 0 {
            	r = 10;
            } r = 10 r 10 {
            	r = n%10;
            } r = n%10 r n%10 n 10 return r; r int n n public static int kuriage(int n){
    	int a = 0;
      	if(n%10 == 0){
        	return n;
        } else {
        	return n + (10-n%10);
        }
    } kuriage {
    	int a = 0;
      	if(n%10 == 0){
        	return n;
        } else {
        	return n + (10-n%10);
        }
    } int a = 0; a 0 if(n%10 == 0){
        	return n;
        } else {
        	return n + (10-n%10);
        } n%10 == 0 n%10 n 10 0 {
        	return n;
        } return n; n {
        	return n + (10-n%10);
        } return n + (10-n%10); n + (10-n%10) n (10-n%10) 10 n%10 n 10 int n n
import java.util.*;
class Main{
	public static void main(String[] args){
    	Scanner scan = new Scanner(System.in);
      	int[] numbers = new int[5];
      	int lastdish = 0;
      	for(int i=0;i<5;i++){
        	numbers[i] = scan.nextInt();
        }
      	for(int i=0;i<5;i++){
        	if(numbers[i]%10 !=0 && resi(numbers[i]) < resi(numbers[lastdish])){
            	lastdish = i;
            }
        }
      	int time = 0;
      	for(int i = 0;i<5;i++){
        	if(i != lastdish){
            	time += kuriage(numbers[i]);
            }
        }
      	time+= numbers[lastdish];
        System.out.println(time);
    }
  	public static int resi(int n){
    	    int r=0;
          	if(n%10 == 0){
            	r = 10;
            } else {
            	r = n%10;
            }
      	return r;
    }
  	public static int kuriage(int n){
    	int a = 0;
      	if(n%10 == 0){
        	return n;
        } else {
        	return n + (10-n%10);
        }
    }
  
}