import java.util.*;
 
public class Main{
	public static void main(String[] args){
    	Scanner scan = new Scanner(System.in);
      	int[] A = new int[5];
      	int[] B = new int[5];
      	for(int i = 0; i < 5; i++){
        	A[i] = scan.nextInt();
          	B[i] = tenth(A[i]);
        }
      	int min = ichi(A[0]);
      	int pointer = 0;
      	int all = 0;
      	int k = 0;
      	for(int i = 0; i < 5; i++){
        	if(ichi(A[i]) < min && ichi(A[i]) != 0){
            	min = ichi(A[i]);
              	pointer = i;
            }
        }
      	all = B[0] + B[1] + B[2] + B[3] + B[4] - B[pointer];
      	all = all + A[pointer];
      	System.out.print(all);
    }
  	public static int tenth(int a){
    	while(a % 10 != 0){
        	a++;
        }
      	return a;
    }
  	public static int ichi(int b){
    	while(b >= 10){
        	b = b - 10;
        }
      	return b;
    }
 
} import java.util.*; util.* java public class Main{
	public static void main(String[] args){
    	Scanner scan = new Scanner(System.in);
      	int[] A = new int[5];
      	int[] B = new int[5];
      	for(int i = 0; i < 5; i++){
        	A[i] = scan.nextInt();
          	B[i] = tenth(A[i]);
        }
      	int min = ichi(A[0]);
      	int pointer = 0;
      	int all = 0;
      	int k = 0;
      	for(int i = 0; i < 5; i++){
        	if(ichi(A[i]) < min && ichi(A[i]) != 0){
            	min = ichi(A[i]);
              	pointer = i;
            }
        }
      	all = B[0] + B[1] + B[2] + B[3] + B[4] - B[pointer];
      	all = all + A[pointer];
      	System.out.print(all);
    }
  	public static int tenth(int a){
    	while(a % 10 != 0){
        	a++;
        }
      	return a;
    }
  	public static int ichi(int b){
    	while(b >= 10){
        	b = b - 10;
        }
      	return b;
    }
 
} Main public static void main(String[] args){
    	Scanner scan = new Scanner(System.in);
      	int[] A = new int[5];
      	int[] B = new int[5];
      	for(int i = 0; i < 5; i++){
        	A[i] = scan.nextInt();
          	B[i] = tenth(A[i]);
        }
      	int min = ichi(A[0]);
      	int pointer = 0;
      	int all = 0;
      	int k = 0;
      	for(int i = 0; i < 5; i++){
        	if(ichi(A[i]) < min && ichi(A[i]) != 0){
            	min = ichi(A[i]);
              	pointer = i;
            }
        }
      	all = B[0] + B[1] + B[2] + B[3] + B[4] - B[pointer];
      	all = all + A[pointer];
      	System.out.print(all);
    } main {
    	Scanner scan = new Scanner(System.in);
      	int[] A = new int[5];
      	int[] B = new int[5];
      	for(int i = 0; i < 5; i++){
        	A[i] = scan.nextInt();
          	B[i] = tenth(A[i]);
        }
      	int min = ichi(A[0]);
      	int pointer = 0;
      	int all = 0;
      	int k = 0;
      	for(int i = 0; i < 5; i++){
        	if(ichi(A[i]) < min && ichi(A[i]) != 0){
            	min = ichi(A[i]);
              	pointer = i;
            }
        }
      	all = B[0] + B[1] + B[2] + B[3] + B[4] - B[pointer];
      	all = all + A[pointer];
      	System.out.print(all);
    } Scanner scan = new Scanner(System.in); scan new Scanner(System.in) int[] A = new int[5]; A new int[5] 5 int[] B = new int[5]; B new int[5] 5 for(int i = 0; i < 5; i++){
        	A[i] = scan.nextInt();
          	B[i] = tenth(A[i]);
        } int i = 0; int i = 0; i 0 i < 5 i 5 i++ i++ i {
        	A[i] = scan.nextInt();
          	B[i] = tenth(A[i]);
        } {
        	A[i] = scan.nextInt();
          	B[i] = tenth(A[i]);
        } A[i] = scan.nextInt() A[i] A i scan.nextInt() scan.nextInt scan B[i] = tenth(A[i]) B[i] B i tenth(A[i]) tenth A[i] A i int min = ichi(A[0]); min ichi(A[0]) ichi A[0] A 0 int pointer = 0; pointer 0 int all = 0; all 0 int k = 0; k 0 for(int i = 0; i < 5; i++){
        	if(ichi(A[i]) < min && ichi(A[i]) != 0){
            	min = ichi(A[i]);
              	pointer = i;
            }
        } int i = 0; int i = 0; i 0 i < 5 i 5 i++ i++ i {
        	if(ichi(A[i]) < min && ichi(A[i]) != 0){
            	min = ichi(A[i]);
              	pointer = i;
            }
        } {
        	if(ichi(A[i]) < min && ichi(A[i]) != 0){
            	min = ichi(A[i]);
              	pointer = i;
            }
        } if(ichi(A[i]) < min && ichi(A[i]) != 0){
            	min = ichi(A[i]);
              	pointer = i;
            } ichi(A[i]) < min && ichi(A[i]) != 0 ichi(A[i]) < min ichi(A[i]) ichi A[i] A i min ichi(A[i]) != 0 ichi(A[i]) ichi A[i] A i 0 {
            	min = ichi(A[i]);
              	pointer = i;
            } min = ichi(A[i]) min ichi(A[i]) ichi A[i] A i pointer = i pointer i all = B[0] + B[1] + B[2] + B[3] + B[4] - B[pointer] all B[0] + B[1] + B[2] + B[3] + B[4] - B[pointer] B[0] + B[1] + B[2] + B[3] + B[4] B[3] B[2] B[0] + B[1] + B[2] + B[3] + B[4] B[0] B 0 B[1] B 1 B[2] B 2 B[3] B 3 B[4] B 4 B[pointer] B pointer all = all + A[pointer] all all + A[pointer] all A[pointer] A pointer System.out.print(all) System.out.print System.out System System.out all String[] args args public static int tenth(int a){
    	while(a % 10 != 0){
        	a++;
        }
      	return a;
    } tenth {
    	while(a % 10 != 0){
        	a++;
        }
      	return a;
    } while(a % 10 != 0){
        	a++;
        } a % 10 != 0 a % 10 a 10 0 {
        	a++;
        } a++ a return a; a int a a public static int ichi(int b){
    	while(b >= 10){
        	b = b - 10;
        }
      	return b;
    } ichi {
    	while(b >= 10){
        	b = b - 10;
        }
      	return b;
    } while(b >= 10){
        	b = b - 10;
        } b >= 10 b 10 {
        	b = b - 10;
        } b = b - 10 b b - 10 b 10 return b; b int b b public class Main{
	public static void main(String[] args){
    	Scanner scan = new Scanner(System.in);
      	int[] A = new int[5];
      	int[] B = new int[5];
      	for(int i = 0; i < 5; i++){
        	A[i] = scan.nextInt();
          	B[i] = tenth(A[i]);
        }
      	int min = ichi(A[0]);
      	int pointer = 0;
      	int all = 0;
      	int k = 0;
      	for(int i = 0; i < 5; i++){
        	if(ichi(A[i]) < min && ichi(A[i]) != 0){
            	min = ichi(A[i]);
              	pointer = i;
            }
        }
      	all = B[0] + B[1] + B[2] + B[3] + B[4] - B[pointer];
      	all = all + A[pointer];
      	System.out.print(all);
    }
  	public static int tenth(int a){
    	while(a % 10 != 0){
        	a++;
        }
      	return a;
    }
  	public static int ichi(int b){
    	while(b >= 10){
        	b = b - 10;
        }
      	return b;
    }
 
} public class Main{
	public static void main(String[] args){
    	Scanner scan = new Scanner(System.in);
      	int[] A = new int[5];
      	int[] B = new int[5];
      	for(int i = 0; i < 5; i++){
        	A[i] = scan.nextInt();
          	B[i] = tenth(A[i]);
        }
      	int min = ichi(A[0]);
      	int pointer = 0;
      	int all = 0;
      	int k = 0;
      	for(int i = 0; i < 5; i++){
        	if(ichi(A[i]) < min && ichi(A[i]) != 0){
            	min = ichi(A[i]);
              	pointer = i;
            }
        }
      	all = B[0] + B[1] + B[2] + B[3] + B[4] - B[pointer];
      	all = all + A[pointer];
      	System.out.print(all);
    }
  	public static int tenth(int a){
    	while(a % 10 != 0){
        	a++;
        }
      	return a;
    }
  	public static int ichi(int b){
    	while(b >= 10){
        	b = b - 10;
        }
      	return b;
    }
 
} Main
import java.util.*;
 
public class Main{
	public static void main(String[] args){
    	Scanner scan = new Scanner(System.in);
      	int[] A = new int[5];
      	int[] B = new int[5];
      	for(int i = 0; i < 5; i++){
        	A[i] = scan.nextInt();
          	B[i] = tenth(A[i]);
        }
      	int min = ichi(A[0]);
      	int pointer = 0;
      	int all = 0;
      	int k = 0;
      	for(int i = 0; i < 5; i++){
        	if(ichi(A[i]) < min && ichi(A[i]) != 0){
            	min = ichi(A[i]);
              	pointer = i;
            }
        }
      	all = B[0] + B[1] + B[2] + B[3] + B[4] - B[pointer];
      	all = all + A[pointer];
      	System.out.print(all);
    }
  	public static int tenth(int a){
    	while(a % 10 != 0){
        	a++;
        }
      	return a;
    }
  	public static int ichi(int b){
    	while(b >= 10){
        	b = b - 10;
        }
      	return b;
    }
 
}