import java.util.*;
public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int[] dish = new int[5];
        for(int i = 0;i<dish.length;i++)dish[i]=sc.nextInt();
        int ans = 0;
        int max=0;
        for(int i = 0;i<dish.length;i++){
            int tmp = dish[i];
            while(tmp%10!=0){
                tmp++;
            }
            if(max<tmp-dish[i])max=tmp-dish[i];
            ans+=tmp;
        }
        System.out.println(ans-max);
    }
} import java.util.*; util.* java public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int[] dish = new int[5];
        for(int i = 0;i<dish.length;i++)dish[i]=sc.nextInt();
        int ans = 0;
        int max=0;
        for(int i = 0;i<dish.length;i++){
            int tmp = dish[i];
            while(tmp%10!=0){
                tmp++;
            }
            if(max<tmp-dish[i])max=tmp-dish[i];
            ans+=tmp;
        }
        System.out.println(ans-max);
    }
} Main public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int[] dish = new int[5];
        for(int i = 0;i<dish.length;i++)dish[i]=sc.nextInt();
        int ans = 0;
        int max=0;
        for(int i = 0;i<dish.length;i++){
            int tmp = dish[i];
            while(tmp%10!=0){
                tmp++;
            }
            if(max<tmp-dish[i])max=tmp-dish[i];
            ans+=tmp;
        }
        System.out.println(ans-max);
    } main {
        Scanner sc = new Scanner(System.in);
        int[] dish = new int[5];
        for(int i = 0;i<dish.length;i++)dish[i]=sc.nextInt();
        int ans = 0;
        int max=0;
        for(int i = 0;i<dish.length;i++){
            int tmp = dish[i];
            while(tmp%10!=0){
                tmp++;
            }
            if(max<tmp-dish[i])max=tmp-dish[i];
            ans+=tmp;
        }
        System.out.println(ans-max);
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int[] dish = new int[5]; dish new int[5] 5 for(int i = 0;i<dish.length;i++)dish[i]=sc.nextInt(); int i = 0; int i = 0; i 0 i<dish.length i dish.length dish dish.length i++ i++ i dish[i]=sc.nextInt(); dish[i]=sc.nextInt() dish[i] dish i sc.nextInt() sc.nextInt sc int ans = 0; ans 0 int max=0; max 0 for(int i = 0;i<dish.length;i++){
            int tmp = dish[i];
            while(tmp%10!=0){
                tmp++;
            }
            if(max<tmp-dish[i])max=tmp-dish[i];
            ans+=tmp;
        } int i = 0; int i = 0; i 0 i<dish.length i dish.length dish dish.length i++ i++ i {
            int tmp = dish[i];
            while(tmp%10!=0){
                tmp++;
            }
            if(max<tmp-dish[i])max=tmp-dish[i];
            ans+=tmp;
        } {
            int tmp = dish[i];
            while(tmp%10!=0){
                tmp++;
            }
            if(max<tmp-dish[i])max=tmp-dish[i];
            ans+=tmp;
        } int tmp = dish[i]; tmp dish[i] dish i while(tmp%10!=0){
                tmp++;
            } tmp%10!=0 tmp%10 tmp 10 0 {
                tmp++;
            } tmp++ tmp if(max<tmp-dish[i])max=tmp-dish[i]; max<tmp-dish[i] max tmp-dish[i] tmp dish[i] dish i max=tmp-dish[i] max tmp-dish[i] tmp dish[i] dish i ans+=tmp ans tmp System.out.println(ans-max) System.out.println System.out System System.out ans-max ans max String[] args args public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int[] dish = new int[5];
        for(int i = 0;i<dish.length;i++)dish[i]=sc.nextInt();
        int ans = 0;
        int max=0;
        for(int i = 0;i<dish.length;i++){
            int tmp = dish[i];
            while(tmp%10!=0){
                tmp++;
            }
            if(max<tmp-dish[i])max=tmp-dish[i];
            ans+=tmp;
        }
        System.out.println(ans-max);
    }
} public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int[] dish = new int[5];
        for(int i = 0;i<dish.length;i++)dish[i]=sc.nextInt();
        int ans = 0;
        int max=0;
        for(int i = 0;i<dish.length;i++){
            int tmp = dish[i];
            while(tmp%10!=0){
                tmp++;
            }
            if(max<tmp-dish[i])max=tmp-dish[i];
            ans+=tmp;
        }
        System.out.println(ans-max);
    }
} Main
import java.util.*;
public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int[] dish = new int[5];
        for(int i = 0;i<dish.length;i++)dish[i]=sc.nextInt();
        int ans = 0;
        int max=0;
        for(int i = 0;i<dish.length;i++){
            int tmp = dish[i];
            while(tmp%10!=0){
                tmp++;
            }
            if(max<tmp-dish[i])max=tmp-dish[i];
            ans+=tmp;
        }
        System.out.println(ans-max);
    }
}
