import java.util.*;
public class Main{
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        int[] a = new int[5];
        int cnt = 0;
        int sabun = 0;
        int max  =0;

        for(int i = 0;i<5;i++){
            a[i] = sc.nextInt();
            cnt+=a[i];
            sabun = (int)(Math.ceil((double)a[i]/10))*10-a[i];
            //System.out.println(sabun);
            cnt+=sabun;
            if(max<sabun){
                max=sabun;
            }

        }

        cnt -=max;

        System.out.println(cnt);
    }
} import java.util.*; util.* java public class Main{
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        int[] a = new int[5];
        int cnt = 0;
        int sabun = 0;
        int max  =0;

        for(int i = 0;i<5;i++){
            a[i] = sc.nextInt();
            cnt+=a[i];
            sabun = (int)(Math.ceil((double)a[i]/10))*10-a[i];
            //System.out.println(sabun);
            cnt+=sabun;
            if(max<sabun){
                max=sabun;
            }

        }

        cnt -=max;

        System.out.println(cnt);
    }
} Main public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        int[] a = new int[5];
        int cnt = 0;
        int sabun = 0;
        int max  =0;

        for(int i = 0;i<5;i++){
            a[i] = sc.nextInt();
            cnt+=a[i];
            sabun = (int)(Math.ceil((double)a[i]/10))*10-a[i];
            //System.out.println(sabun);
            cnt+=sabun;
            if(max<sabun){
                max=sabun;
            }

        }

        cnt -=max;

        System.out.println(cnt);
    } main {
        Scanner sc = new Scanner(System.in);
        int[] a = new int[5];
        int cnt = 0;
        int sabun = 0;
        int max  =0;

        for(int i = 0;i<5;i++){
            a[i] = sc.nextInt();
            cnt+=a[i];
            sabun = (int)(Math.ceil((double)a[i]/10))*10-a[i];
            //System.out.println(sabun);
            cnt+=sabun;
            if(max<sabun){
                max=sabun;
            }

        }

        cnt -=max;

        System.out.println(cnt);
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int[] a = new int[5]; a new int[5] 5 int cnt = 0; cnt 0 int sabun = 0; sabun 0 int max  =0; max 0 for(int i = 0;i<5;i++){
            a[i] = sc.nextInt();
            cnt+=a[i];
            sabun = (int)(Math.ceil((double)a[i]/10))*10-a[i];
            //System.out.println(sabun);
            cnt+=sabun;
            if(max<sabun){
                max=sabun;
            }

        } int i = 0; int i = 0; i 0 i<5 i 5 i++ i++ i {
            a[i] = sc.nextInt();
            cnt+=a[i];
            sabun = (int)(Math.ceil((double)a[i]/10))*10-a[i];
            //System.out.println(sabun);
            cnt+=sabun;
            if(max<sabun){
                max=sabun;
            }

        } {
            a[i] = sc.nextInt();
            cnt+=a[i];
            sabun = (int)(Math.ceil((double)a[i]/10))*10-a[i];
            //System.out.println(sabun);
            cnt+=sabun;
            if(max<sabun){
                max=sabun;
            }

        } a[i] = sc.nextInt() a[i] a i sc.nextInt() sc.nextInt sc cnt+=a[i] cnt a[i] a i sabun = (int)(Math.ceil((double)a[i]/10))*10-a[i] sabun (int)(Math.ceil((double)a[i]/10))*10-a[i] (int)(Math.ceil((double)a[i]/10))*10 (int)(Math.ceil((double)a[i]/10)) Math.ceil Math (double)a[i]/10 (double)a[i] a i 10 10 a[i] a i cnt+=sabun cnt sabun if(max<sabun){
                max=sabun;
            } max<sabun max sabun {
                max=sabun;
            } max=sabun max sabun cnt -=max cnt max System.out.println(cnt) System.out.println System.out System System.out cnt String[] args args public class Main{
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        int[] a = new int[5];
        int cnt = 0;
        int sabun = 0;
        int max  =0;

        for(int i = 0;i<5;i++){
            a[i] = sc.nextInt();
            cnt+=a[i];
            sabun = (int)(Math.ceil((double)a[i]/10))*10-a[i];
            //System.out.println(sabun);
            cnt+=sabun;
            if(max<sabun){
                max=sabun;
            }

        }

        cnt -=max;

        System.out.println(cnt);
    }
} public class Main{
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        int[] a = new int[5];
        int cnt = 0;
        int sabun = 0;
        int max  =0;

        for(int i = 0;i<5;i++){
            a[i] = sc.nextInt();
            cnt+=a[i];
            sabun = (int)(Math.ceil((double)a[i]/10))*10-a[i];
            //System.out.println(sabun);
            cnt+=sabun;
            if(max<sabun){
                max=sabun;
            }

        }

        cnt -=max;

        System.out.println(cnt);
    }
} Main
import java.util.*;
public class Main{
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        int[] a = new int[5];
        int cnt = 0;
        int sabun = 0;
        int max  =0;

        for(int i = 0;i<5;i++){
            a[i] = sc.nextInt();
            cnt+=a[i];
            sabun = (int)(Math.ceil((double)a[i]/10))*10-a[i];
            //System.out.println(sabun);
            cnt+=sabun;
            if(max<sabun){
                max=sabun;
            }

        }

        cnt -=max;

        System.out.println(cnt);
    }
}
