import java.util.Scanner;

public class Main {

    public static void main(String[] args) {
        
        Scanner sc = new Scanner(System.in);
        
        int[] x = new int[5];
        for(int i = 0; i < 5; i++){
            x[i] = Integer.parseInt(sc.next());
        }
        
        int y;
        int min = 11;
        int last = 0;
        for(int i = 0; i < 5; i++){
            y = x[i] % 10;
            if(y == 0){
                y =10;
            }
            if(y < min){
                last = i;
                min = y;
            }
        }
        
        int time = 0;
        for(int i = 0; i < 5; i++){
            if(i == last){
                time += x[i];
            }else{
                if(x[i] % 10 == 0){
                    time += x[i];
                }else{
                    time += x[i] + (10 - (x[i] % 10));
                }
            }
        }
        
        System.out.println(time);
    }
} import java.util.Scanner; Scanner java.util public class Main {

    public static void main(String[] args) {
        
        Scanner sc = new Scanner(System.in);
        
        int[] x = new int[5];
        for(int i = 0; i < 5; i++){
            x[i] = Integer.parseInt(sc.next());
        }
        
        int y;
        int min = 11;
        int last = 0;
        for(int i = 0; i < 5; i++){
            y = x[i] % 10;
            if(y == 0){
                y =10;
            }
            if(y < min){
                last = i;
                min = y;
            }
        }
        
        int time = 0;
        for(int i = 0; i < 5; i++){
            if(i == last){
                time += x[i];
            }else{
                if(x[i] % 10 == 0){
                    time += x[i];
                }else{
                    time += x[i] + (10 - (x[i] % 10));
                }
            }
        }
        
        System.out.println(time);
    }
} Main public static void main(String[] args) {
        
        Scanner sc = new Scanner(System.in);
        
        int[] x = new int[5];
        for(int i = 0; i < 5; i++){
            x[i] = Integer.parseInt(sc.next());
        }
        
        int y;
        int min = 11;
        int last = 0;
        for(int i = 0; i < 5; i++){
            y = x[i] % 10;
            if(y == 0){
                y =10;
            }
            if(y < min){
                last = i;
                min = y;
            }
        }
        
        int time = 0;
        for(int i = 0; i < 5; i++){
            if(i == last){
                time += x[i];
            }else{
                if(x[i] % 10 == 0){
                    time += x[i];
                }else{
                    time += x[i] + (10 - (x[i] % 10));
                }
            }
        }
        
        System.out.println(time);
    } main {
        
        Scanner sc = new Scanner(System.in);
        
        int[] x = new int[5];
        for(int i = 0; i < 5; i++){
            x[i] = Integer.parseInt(sc.next());
        }
        
        int y;
        int min = 11;
        int last = 0;
        for(int i = 0; i < 5; i++){
            y = x[i] % 10;
            if(y == 0){
                y =10;
            }
            if(y < min){
                last = i;
                min = y;
            }
        }
        
        int time = 0;
        for(int i = 0; i < 5; i++){
            if(i == last){
                time += x[i];
            }else{
                if(x[i] % 10 == 0){
                    time += x[i];
                }else{
                    time += x[i] + (10 - (x[i] % 10));
                }
            }
        }
        
        System.out.println(time);
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int[] x = new int[5]; x new int[5] 5 for(int i = 0; i < 5; i++){
            x[i] = Integer.parseInt(sc.next());
        } int i = 0; int i = 0; i 0 i < 5 i 5 i++ i++ i {
            x[i] = Integer.parseInt(sc.next());
        } {
            x[i] = Integer.parseInt(sc.next());
        } x[i] = Integer.parseInt(sc.next()) x[i] x i Integer.parseInt(sc.next()) Integer.parseInt Integer sc.next() sc.next sc int y; y int min = 11; min 11 int last = 0; last 0 for(int i = 0; i < 5; i++){
            y = x[i] % 10;
            if(y == 0){
                y =10;
            }
            if(y < min){
                last = i;
                min = y;
            }
        } int i = 0; int i = 0; i 0 i < 5 i 5 i++ i++ i {
            y = x[i] % 10;
            if(y == 0){
                y =10;
            }
            if(y < min){
                last = i;
                min = y;
            }
        } {
            y = x[i] % 10;
            if(y == 0){
                y =10;
            }
            if(y < min){
                last = i;
                min = y;
            }
        } y = x[i] % 10 y x[i] % 10 x[i] x i 10 if(y == 0){
                y =10;
            } y == 0 y 0 {
                y =10;
            } y =10 y 10 if(y < min){
                last = i;
                min = y;
            } y < min y min {
                last = i;
                min = y;
            } last = i last i min = y min y int time = 0; time 0 for(int i = 0; i < 5; i++){
            if(i == last){
                time += x[i];
            }else{
                if(x[i] % 10 == 0){
                    time += x[i];
                }else{
                    time += x[i] + (10 - (x[i] % 10));
                }
            }
        } int i = 0; int i = 0; i 0 i < 5 i 5 i++ i++ i {
            if(i == last){
                time += x[i];
            }else{
                if(x[i] % 10 == 0){
                    time += x[i];
                }else{
                    time += x[i] + (10 - (x[i] % 10));
                }
            }
        } {
            if(i == last){
                time += x[i];
            }else{
                if(x[i] % 10 == 0){
                    time += x[i];
                }else{
                    time += x[i] + (10 - (x[i] % 10));
                }
            }
        } if(i == last){
                time += x[i];
            }else{
                if(x[i] % 10 == 0){
                    time += x[i];
                }else{
                    time += x[i] + (10 - (x[i] % 10));
                }
            } i == last i last {
                time += x[i];
            } time += x[i] time x[i] x i {
                if(x[i] % 10 == 0){
                    time += x[i];
                }else{
                    time += x[i] + (10 - (x[i] % 10));
                }
            } if(x[i] % 10 == 0){
                    time += x[i];
                }else{
                    time += x[i] + (10 - (x[i] % 10));
                } x[i] % 10 == 0 x[i] % 10 x[i] x i 10 0 {
                    time += x[i];
                } time += x[i] time x[i] x i {
                    time += x[i] + (10 - (x[i] % 10));
                } time += x[i] + (10 - (x[i] % 10)) time x[i] + (10 - (x[i] % 10)) x[i] x i (10 - (x[i] % 10)) 10 (x[i] % 10) x[i] x i 10 System.out.println(time) System.out.println System.out System System.out time String[] args args public class Main {

    public static void main(String[] args) {
        
        Scanner sc = new Scanner(System.in);
        
        int[] x = new int[5];
        for(int i = 0; i < 5; i++){
            x[i] = Integer.parseInt(sc.next());
        }
        
        int y;
        int min = 11;
        int last = 0;
        for(int i = 0; i < 5; i++){
            y = x[i] % 10;
            if(y == 0){
                y =10;
            }
            if(y < min){
                last = i;
                min = y;
            }
        }
        
        int time = 0;
        for(int i = 0; i < 5; i++){
            if(i == last){
                time += x[i];
            }else{
                if(x[i] % 10 == 0){
                    time += x[i];
                }else{
                    time += x[i] + (10 - (x[i] % 10));
                }
            }
        }
        
        System.out.println(time);
    }
} public class Main {

    public static void main(String[] args) {
        
        Scanner sc = new Scanner(System.in);
        
        int[] x = new int[5];
        for(int i = 0; i < 5; i++){
            x[i] = Integer.parseInt(sc.next());
        }
        
        int y;
        int min = 11;
        int last = 0;
        for(int i = 0; i < 5; i++){
            y = x[i] % 10;
            if(y == 0){
                y =10;
            }
            if(y < min){
                last = i;
                min = y;
            }
        }
        
        int time = 0;
        for(int i = 0; i < 5; i++){
            if(i == last){
                time += x[i];
            }else{
                if(x[i] % 10 == 0){
                    time += x[i];
                }else{
                    time += x[i] + (10 - (x[i] % 10));
                }
            }
        }
        
        System.out.println(time);
    }
} Main
import java.util.Scanner;

public class Main {

    public static void main(String[] args) {
        
        Scanner sc = new Scanner(System.in);
        
        int[] x = new int[5];
        for(int i = 0; i < 5; i++){
            x[i] = Integer.parseInt(sc.next());
        }
        
        int y;
        int min = 11;
        int last = 0;
        for(int i = 0; i < 5; i++){
            y = x[i] % 10;
            if(y == 0){
                y =10;
            }
            if(y < min){
                last = i;
                min = y;
            }
        }
        
        int time = 0;
        for(int i = 0; i < 5; i++){
            if(i == last){
                time += x[i];
            }else{
                if(x[i] % 10 == 0){
                    time += x[i];
                }else{
                    time += x[i] + (10 - (x[i] % 10));
                }
            }
        }
        
        System.out.println(time);
    }
}