import java.util.*;
 
public class Main {
    public static void main(String args[]) {
        
       Scanner sc = new Scanner(System.in);
       double A = sc.nextInt();
       double B = sc.nextInt();
       double C = sc.nextInt();
       double D = sc.nextInt();
       double E = sc.nextInt();
       
       double AX =Math.ceil(A/10) * 10;
       double BX =Math.ceil(B/10) * 10;
       double CX =Math.ceil(C/10) * 10;
       double DX =Math.ceil(D/10) * 10;
       double EX =Math.ceil(E/10) * 10;
       
       int a=(int)AX -(int)A;
       int b=(int)BX -(int)B;
       int c=(int)CX -(int)C;
       int d=(int)DX -(int)D;
       int e=(int)EX -(int)E;
       
       int [] last = {a,b,c,d,e};
       
       int intMax =last[0];
       int total =(int)AX+(int)BX+(int)CX+(int)DX+(int)EX;
       
       for(int i = 1; i < last.length; i++) {
           if(intMax <= last[i]) {
               intMax = last[i];
               
           }
           
       }
       System.out.println(total-intMax);
       
    
        
    }
    
} import java.util.*; util.* java public class Main {
    public static void main(String args[]) {
        
       Scanner sc = new Scanner(System.in);
       double A = sc.nextInt();
       double B = sc.nextInt();
       double C = sc.nextInt();
       double D = sc.nextInt();
       double E = sc.nextInt();
       
       double AX =Math.ceil(A/10) * 10;
       double BX =Math.ceil(B/10) * 10;
       double CX =Math.ceil(C/10) * 10;
       double DX =Math.ceil(D/10) * 10;
       double EX =Math.ceil(E/10) * 10;
       
       int a=(int)AX -(int)A;
       int b=(int)BX -(int)B;
       int c=(int)CX -(int)C;
       int d=(int)DX -(int)D;
       int e=(int)EX -(int)E;
       
       int [] last = {a,b,c,d,e};
       
       int intMax =last[0];
       int total =(int)AX+(int)BX+(int)CX+(int)DX+(int)EX;
       
       for(int i = 1; i < last.length; i++) {
           if(intMax <= last[i]) {
               intMax = last[i];
               
           }
           
       }
       System.out.println(total-intMax);
       
    
        
    }
    
} Main public static void main(String args[]) {
        
       Scanner sc = new Scanner(System.in);
       double A = sc.nextInt();
       double B = sc.nextInt();
       double C = sc.nextInt();
       double D = sc.nextInt();
       double E = sc.nextInt();
       
       double AX =Math.ceil(A/10) * 10;
       double BX =Math.ceil(B/10) * 10;
       double CX =Math.ceil(C/10) * 10;
       double DX =Math.ceil(D/10) * 10;
       double EX =Math.ceil(E/10) * 10;
       
       int a=(int)AX -(int)A;
       int b=(int)BX -(int)B;
       int c=(int)CX -(int)C;
       int d=(int)DX -(int)D;
       int e=(int)EX -(int)E;
       
       int [] last = {a,b,c,d,e};
       
       int intMax =last[0];
       int total =(int)AX+(int)BX+(int)CX+(int)DX+(int)EX;
       
       for(int i = 1; i < last.length; i++) {
           if(intMax <= last[i]) {
               intMax = last[i];
               
           }
           
       }
       System.out.println(total-intMax);
       
    
        
    } main {
        
       Scanner sc = new Scanner(System.in);
       double A = sc.nextInt();
       double B = sc.nextInt();
       double C = sc.nextInt();
       double D = sc.nextInt();
       double E = sc.nextInt();
       
       double AX =Math.ceil(A/10) * 10;
       double BX =Math.ceil(B/10) * 10;
       double CX =Math.ceil(C/10) * 10;
       double DX =Math.ceil(D/10) * 10;
       double EX =Math.ceil(E/10) * 10;
       
       int a=(int)AX -(int)A;
       int b=(int)BX -(int)B;
       int c=(int)CX -(int)C;
       int d=(int)DX -(int)D;
       int e=(int)EX -(int)E;
       
       int [] last = {a,b,c,d,e};
       
       int intMax =last[0];
       int total =(int)AX+(int)BX+(int)CX+(int)DX+(int)EX;
       
       for(int i = 1; i < last.length; i++) {
           if(intMax <= last[i]) {
               intMax = last[i];
               
           }
           
       }
       System.out.println(total-intMax);
       
    
        
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) double A = sc.nextInt(); A sc.nextInt() sc.nextInt sc double B = sc.nextInt(); B sc.nextInt() sc.nextInt sc double C = sc.nextInt(); C sc.nextInt() sc.nextInt sc double D = sc.nextInt(); D sc.nextInt() sc.nextInt sc double E = sc.nextInt(); E sc.nextInt() sc.nextInt sc double AX =Math.ceil(A/10) * 10; AX Math.ceil(A/10) * 10 Math.ceil(A/10) Math.ceil Math A/10 A 10 10 double BX =Math.ceil(B/10) * 10; BX Math.ceil(B/10) * 10 Math.ceil(B/10) Math.ceil Math B/10 B 10 10 double CX =Math.ceil(C/10) * 10; CX Math.ceil(C/10) * 10 Math.ceil(C/10) Math.ceil Math C/10 C 10 10 double DX =Math.ceil(D/10) * 10; DX Math.ceil(D/10) * 10 Math.ceil(D/10) Math.ceil Math D/10 D 10 10 double EX =Math.ceil(E/10) * 10; EX Math.ceil(E/10) * 10 Math.ceil(E/10) Math.ceil Math E/10 E 10 10 int a=(int)AX -(int)A; a (int)AX -(int)A (int)AX (int)A int b=(int)BX -(int)B; b (int)BX -(int)B (int)BX (int)B int c=(int)CX -(int)C; c (int)CX -(int)C (int)CX (int)C int d=(int)DX -(int)D; d (int)DX -(int)D (int)DX (int)D int e=(int)EX -(int)E; e (int)EX -(int)E (int)EX (int)E int [] last = {a,b,c,d,e}; last {a,b,c,d,e} a b c d e int intMax =last[0]; intMax last[0] last 0 int total =(int)AX+(int)BX+(int)CX+(int)DX+(int)EX; total (int)AX+(int)BX+(int)CX+(int)DX+(int)EX (int)DX (int)CX (int)AX+(int)BX+(int)CX+(int)DX+(int)EX (int)AX (int)BX (int)CX (int)DX (int)EX for(int i = 1; i < last.length; i++) {
           if(intMax <= last[i]) {
               intMax = last[i];
               
           }
           
       } int i = 1; int i = 1; i 1 i < last.length i last.length last last.length i++ i++ i {
           if(intMax <= last[i]) {
               intMax = last[i];
               
           }
           
       } {
           if(intMax <= last[i]) {
               intMax = last[i];
               
           }
           
       } if(intMax <= last[i]) {
               intMax = last[i];
               
           } intMax <= last[i] intMax last[i] last i {
               intMax = last[i];
               
           } intMax = last[i] intMax last[i] last i System.out.println(total-intMax) System.out.println System.out System System.out total-intMax total intMax String args[] args public class Main {
    public static void main(String args[]) {
        
       Scanner sc = new Scanner(System.in);
       double A = sc.nextInt();
       double B = sc.nextInt();
       double C = sc.nextInt();
       double D = sc.nextInt();
       double E = sc.nextInt();
       
       double AX =Math.ceil(A/10) * 10;
       double BX =Math.ceil(B/10) * 10;
       double CX =Math.ceil(C/10) * 10;
       double DX =Math.ceil(D/10) * 10;
       double EX =Math.ceil(E/10) * 10;
       
       int a=(int)AX -(int)A;
       int b=(int)BX -(int)B;
       int c=(int)CX -(int)C;
       int d=(int)DX -(int)D;
       int e=(int)EX -(int)E;
       
       int [] last = {a,b,c,d,e};
       
       int intMax =last[0];
       int total =(int)AX+(int)BX+(int)CX+(int)DX+(int)EX;
       
       for(int i = 1; i < last.length; i++) {
           if(intMax <= last[i]) {
               intMax = last[i];
               
           }
           
       }
       System.out.println(total-intMax);
       
    
        
    }
    
} public class Main {
    public static void main(String args[]) {
        
       Scanner sc = new Scanner(System.in);
       double A = sc.nextInt();
       double B = sc.nextInt();
       double C = sc.nextInt();
       double D = sc.nextInt();
       double E = sc.nextInt();
       
       double AX =Math.ceil(A/10) * 10;
       double BX =Math.ceil(B/10) * 10;
       double CX =Math.ceil(C/10) * 10;
       double DX =Math.ceil(D/10) * 10;
       double EX =Math.ceil(E/10) * 10;
       
       int a=(int)AX -(int)A;
       int b=(int)BX -(int)B;
       int c=(int)CX -(int)C;
       int d=(int)DX -(int)D;
       int e=(int)EX -(int)E;
       
       int [] last = {a,b,c,d,e};
       
       int intMax =last[0];
       int total =(int)AX+(int)BX+(int)CX+(int)DX+(int)EX;
       
       for(int i = 1; i < last.length; i++) {
           if(intMax <= last[i]) {
               intMax = last[i];
               
           }
           
       }
       System.out.println(total-intMax);
       
    
        
    }
    
} Main
import java.util.*;
 
public class Main {
    public static void main(String args[]) {
        
       Scanner sc = new Scanner(System.in);
       double A = sc.nextInt();
       double B = sc.nextInt();
       double C = sc.nextInt();
       double D = sc.nextInt();
       double E = sc.nextInt();
       
       double AX =Math.ceil(A/10) * 10;
       double BX =Math.ceil(B/10) * 10;
       double CX =Math.ceil(C/10) * 10;
       double DX =Math.ceil(D/10) * 10;
       double EX =Math.ceil(E/10) * 10;
       
       int a=(int)AX -(int)A;
       int b=(int)BX -(int)B;
       int c=(int)CX -(int)C;
       int d=(int)DX -(int)D;
       int e=(int)EX -(int)E;
       
       int [] last = {a,b,c,d,e};
       
       int intMax =last[0];
       int total =(int)AX+(int)BX+(int)CX+(int)DX+(int)EX;
       
       for(int i = 1; i < last.length; i++) {
           if(intMax <= last[i]) {
               intMax = last[i];
               
           }
           
       }
       System.out.println(total-intMax);
       
    
        
    }
    
}