import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int[] dishes = new int[5];
        int idx = -1;
        int max = -1;
        int sum = 0;
        int tmp ;
        for(int i=0;i<5;i++){
            tmp = Integer.parseInt(sc.next());
            if((tmp+9)/10*10-tmp > max){
                idx = i;
                max = (tmp+9)/10*10-tmp;
            }
            dishes[i] = tmp;
        }
        sc.close();
        for(int i=0;i<5;i++){
            if(i==idx){
                sum+=dishes[idx];
            }else{
                sum+=(dishes[i]+9)/10*10;
            }
        }
        System.out.println(sum);
    }
} import java.util.Scanner; Scanner java.util public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int[] dishes = new int[5];
        int idx = -1;
        int max = -1;
        int sum = 0;
        int tmp ;
        for(int i=0;i<5;i++){
            tmp = Integer.parseInt(sc.next());
            if((tmp+9)/10*10-tmp > max){
                idx = i;
                max = (tmp+9)/10*10-tmp;
            }
            dishes[i] = tmp;
        }
        sc.close();
        for(int i=0;i<5;i++){
            if(i==idx){
                sum+=dishes[idx];
            }else{
                sum+=(dishes[i]+9)/10*10;
            }
        }
        System.out.println(sum);
    }
} Main public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int[] dishes = new int[5];
        int idx = -1;
        int max = -1;
        int sum = 0;
        int tmp ;
        for(int i=0;i<5;i++){
            tmp = Integer.parseInt(sc.next());
            if((tmp+9)/10*10-tmp > max){
                idx = i;
                max = (tmp+9)/10*10-tmp;
            }
            dishes[i] = tmp;
        }
        sc.close();
        for(int i=0;i<5;i++){
            if(i==idx){
                sum+=dishes[idx];
            }else{
                sum+=(dishes[i]+9)/10*10;
            }
        }
        System.out.println(sum);
    } main {
        Scanner sc = new Scanner(System.in);
        int[] dishes = new int[5];
        int idx = -1;
        int max = -1;
        int sum = 0;
        int tmp ;
        for(int i=0;i<5;i++){
            tmp = Integer.parseInt(sc.next());
            if((tmp+9)/10*10-tmp > max){
                idx = i;
                max = (tmp+9)/10*10-tmp;
            }
            dishes[i] = tmp;
        }
        sc.close();
        for(int i=0;i<5;i++){
            if(i==idx){
                sum+=dishes[idx];
            }else{
                sum+=(dishes[i]+9)/10*10;
            }
        }
        System.out.println(sum);
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int[] dishes = new int[5]; dishes new int[5] 5 int idx = -1; idx -1 1 int max = -1; max -1 1 int sum = 0; sum 0 int tmp ; tmp for(int i=0;i<5;i++){
            tmp = Integer.parseInt(sc.next());
            if((tmp+9)/10*10-tmp > max){
                idx = i;
                max = (tmp+9)/10*10-tmp;
            }
            dishes[i] = tmp;
        } int i=0; int i=0; i 0 i<5 i 5 i++ i++ i {
            tmp = Integer.parseInt(sc.next());
            if((tmp+9)/10*10-tmp > max){
                idx = i;
                max = (tmp+9)/10*10-tmp;
            }
            dishes[i] = tmp;
        } {
            tmp = Integer.parseInt(sc.next());
            if((tmp+9)/10*10-tmp > max){
                idx = i;
                max = (tmp+9)/10*10-tmp;
            }
            dishes[i] = tmp;
        } tmp = Integer.parseInt(sc.next()) tmp Integer.parseInt(sc.next()) Integer.parseInt Integer sc.next() sc.next sc if((tmp+9)/10*10-tmp > max){
                idx = i;
                max = (tmp+9)/10*10-tmp;
            } (tmp+9)/10*10-tmp > max (tmp+9)/10*10-tmp (tmp+9)/10*10 (tmp+9)/10 (tmp+9) tmp 9 10 10 tmp max {
                idx = i;
                max = (tmp+9)/10*10-tmp;
            } idx = i idx i max = (tmp+9)/10*10-tmp max (tmp+9)/10*10-tmp (tmp+9)/10*10 (tmp+9)/10 (tmp+9) tmp 9 10 10 tmp dishes[i] = tmp dishes[i] dishes i tmp sc.close() sc.close sc for(int i=0;i<5;i++){
            if(i==idx){
                sum+=dishes[idx];
            }else{
                sum+=(dishes[i]+9)/10*10;
            }
        } int i=0; int i=0; i 0 i<5 i 5 i++ i++ i {
            if(i==idx){
                sum+=dishes[idx];
            }else{
                sum+=(dishes[i]+9)/10*10;
            }
        } {
            if(i==idx){
                sum+=dishes[idx];
            }else{
                sum+=(dishes[i]+9)/10*10;
            }
        } if(i==idx){
                sum+=dishes[idx];
            }else{
                sum+=(dishes[i]+9)/10*10;
            } i==idx i idx {
                sum+=dishes[idx];
            } sum+=dishes[idx] sum dishes[idx] dishes idx {
                sum+=(dishes[i]+9)/10*10;
            } sum+=(dishes[i]+9)/10*10 sum (dishes[i]+9)/10*10 (dishes[i]+9)/10 (dishes[i]+9) dishes[i] dishes i 9 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);
        int[] dishes = new int[5];
        int idx = -1;
        int max = -1;
        int sum = 0;
        int tmp ;
        for(int i=0;i<5;i++){
            tmp = Integer.parseInt(sc.next());
            if((tmp+9)/10*10-tmp > max){
                idx = i;
                max = (tmp+9)/10*10-tmp;
            }
            dishes[i] = tmp;
        }
        sc.close();
        for(int i=0;i<5;i++){
            if(i==idx){
                sum+=dishes[idx];
            }else{
                sum+=(dishes[i]+9)/10*10;
            }
        }
        System.out.println(sum);
    }
} public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int[] dishes = new int[5];
        int idx = -1;
        int max = -1;
        int sum = 0;
        int tmp ;
        for(int i=0;i<5;i++){
            tmp = Integer.parseInt(sc.next());
            if((tmp+9)/10*10-tmp > max){
                idx = i;
                max = (tmp+9)/10*10-tmp;
            }
            dishes[i] = tmp;
        }
        sc.close();
        for(int i=0;i<5;i++){
            if(i==idx){
                sum+=dishes[idx];
            }else{
                sum+=(dishes[i]+9)/10*10;
            }
        }
        System.out.println(sum);
    }
} Main
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int[] dishes = new int[5];
        int idx = -1;
        int max = -1;
        int sum = 0;
        int tmp ;
        for(int i=0;i<5;i++){
            tmp = Integer.parseInt(sc.next());
            if((tmp+9)/10*10-tmp > max){
                idx = i;
                max = (tmp+9)/10*10-tmp;
            }
            dishes[i] = tmp;
        }
        sc.close();
        for(int i=0;i<5;i++){
            if(i==idx){
                sum+=dishes[idx];
            }else{
                sum+=(dishes[i]+9)/10*10;
            }
        }
        System.out.println(sum);
    }
}