import java.util.*;

public class Main{
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        
        double[] A = new double[5];
        
        int pos=0, min=10;
        for(int i=0; i<5; i++){
            String x = sc.next();
            A[i] = Integer.parseInt(x);
            int y = x.charAt(x.length()-1) - '0';
            if(y!=0 && y<min){
                min = y;
                pos = i;
            }
        }
        
        int sum = 0;
        for(int i=0; i<5; i++){
            if(i == pos){
                sum += A[i];
            }else{
                sum += Math.ceil(A[i]/10)*10;
            }
        }
        
        System.out.println(sum);
    }
} import java.util.*; util.* java public class Main{
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        
        double[] A = new double[5];
        
        int pos=0, min=10;
        for(int i=0; i<5; i++){
            String x = sc.next();
            A[i] = Integer.parseInt(x);
            int y = x.charAt(x.length()-1) - '0';
            if(y!=0 && y<min){
                min = y;
                pos = i;
            }
        }
        
        int sum = 0;
        for(int i=0; i<5; i++){
            if(i == pos){
                sum += A[i];
            }else{
                sum += Math.ceil(A[i]/10)*10;
            }
        }
        
        System.out.println(sum);
    }
} Main public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        
        double[] A = new double[5];
        
        int pos=0, min=10;
        for(int i=0; i<5; i++){
            String x = sc.next();
            A[i] = Integer.parseInt(x);
            int y = x.charAt(x.length()-1) - '0';
            if(y!=0 && y<min){
                min = y;
                pos = i;
            }
        }
        
        int sum = 0;
        for(int i=0; i<5; i++){
            if(i == pos){
                sum += A[i];
            }else{
                sum += Math.ceil(A[i]/10)*10;
            }
        }
        
        System.out.println(sum);
    } main {
        Scanner sc = new Scanner(System.in);
        
        double[] A = new double[5];
        
        int pos=0, min=10;
        for(int i=0; i<5; i++){
            String x = sc.next();
            A[i] = Integer.parseInt(x);
            int y = x.charAt(x.length()-1) - '0';
            if(y!=0 && y<min){
                min = y;
                pos = i;
            }
        }
        
        int sum = 0;
        for(int i=0; i<5; i++){
            if(i == pos){
                sum += A[i];
            }else{
                sum += Math.ceil(A[i]/10)*10;
            }
        }
        
        System.out.println(sum);
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) double[] A = new double[5]; A new double[5] 5 int pos=0 pos 0 min=10; min 10 for(int i=0; i<5; i++){
            String x = sc.next();
            A[i] = Integer.parseInt(x);
            int y = x.charAt(x.length()-1) - '0';
            if(y!=0 && y<min){
                min = y;
                pos = i;
            }
        } int i=0; int i=0; i 0 i<5 i 5 i++ i++ i {
            String x = sc.next();
            A[i] = Integer.parseInt(x);
            int y = x.charAt(x.length()-1) - '0';
            if(y!=0 && y<min){
                min = y;
                pos = i;
            }
        } {
            String x = sc.next();
            A[i] = Integer.parseInt(x);
            int y = x.charAt(x.length()-1) - '0';
            if(y!=0 && y<min){
                min = y;
                pos = i;
            }
        } String x = sc.next(); x sc.next() sc.next sc A[i] = Integer.parseInt(x) A[i] A i Integer.parseInt(x) Integer.parseInt Integer x int y = x.charAt(x.length()-1) - '0'; y x.charAt(x.length()-1) - '0' x.charAt(x.length()-1) x.charAt x x.length()-1 x.length() x.length x 1 '0' if(y!=0 && y<min){
                min = y;
                pos = i;
            } y!=0 && y<min y!=0 y 0 y<min y min {
                min = y;
                pos = i;
            } min = y min y pos = i pos i int sum = 0; sum 0 for(int i=0; i<5; i++){
            if(i == pos){
                sum += A[i];
            }else{
                sum += Math.ceil(A[i]/10)*10;
            }
        } int i=0; int i=0; i 0 i<5 i 5 i++ i++ i {
            if(i == pos){
                sum += A[i];
            }else{
                sum += Math.ceil(A[i]/10)*10;
            }
        } {
            if(i == pos){
                sum += A[i];
            }else{
                sum += Math.ceil(A[i]/10)*10;
            }
        } if(i == pos){
                sum += A[i];
            }else{
                sum += Math.ceil(A[i]/10)*10;
            } i == pos i pos {
                sum += A[i];
            } sum += A[i] sum A[i] A i {
                sum += Math.ceil(A[i]/10)*10;
            } sum += Math.ceil(A[i]/10)*10 sum Math.ceil(A[i]/10)*10 Math.ceil(A[i]/10) Math.ceil Math A[i]/10 A[i] A i 10 10 System.out.println(sum) System.out.println System.out System System.out sum String[] args args public class Main{
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        
        double[] A = new double[5];
        
        int pos=0, min=10;
        for(int i=0; i<5; i++){
            String x = sc.next();
            A[i] = Integer.parseInt(x);
            int y = x.charAt(x.length()-1) - '0';
            if(y!=0 && y<min){
                min = y;
                pos = i;
            }
        }
        
        int sum = 0;
        for(int i=0; i<5; i++){
            if(i == pos){
                sum += A[i];
            }else{
                sum += Math.ceil(A[i]/10)*10;
            }
        }
        
        System.out.println(sum);
    }
} public class Main{
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        
        double[] A = new double[5];
        
        int pos=0, min=10;
        for(int i=0; i<5; i++){
            String x = sc.next();
            A[i] = Integer.parseInt(x);
            int y = x.charAt(x.length()-1) - '0';
            if(y!=0 && y<min){
                min = y;
                pos = i;
            }
        }
        
        int sum = 0;
        for(int i=0; i<5; i++){
            if(i == pos){
                sum += A[i];
            }else{
                sum += Math.ceil(A[i]/10)*10;
            }
        }
        
        System.out.println(sum);
    }
} Main
import java.util.*;

public class Main{
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        
        double[] A = new double[5];
        
        int pos=0, min=10;
        for(int i=0; i<5; i++){
            String x = sc.next();
            A[i] = Integer.parseInt(x);
            int y = x.charAt(x.length()-1) - '0';
            if(y!=0 && y<min){
                min = y;
                pos = i;
            }
        }
        
        int sum = 0;
        for(int i=0; i<5; i++){
            if(i == pos){
                sum += A[i];
            }else{
                sum += Math.ceil(A[i]/10)*10;
            }
        }
        
        System.out.println(sum);
    }
}
