import java.util.Scanner;
class Main{
    public static void main(String[] args) {
        //入力
        Scanner scn=new Scanner(System.in);
        int[] time=new int[5];
        for(int i=0;i<5;i++){
            time[i]=scn.nextInt();
        }
        //処理
        int min_no1=9;
        int place=0;
        int cnt=0;
        int total=0;
        for(int i=0;i<5;i++){
            if(time[i]%10!=0){
                if( min_no1>time[i]%10) {
                    min_no1=time[i]%10;
                    place=i;
                }
            }else{
                cnt++;
            }
        }
        if(cnt==5)min_no1=0; 

        for(int i=0;i<5;i++){
            if(time[i]%10==0||place==i){
                total+=time[i];
            }else{
                total+=time[i]-time[i]%10+10;
            }
        }
        //出力
        System.out.println(total);
    }
} import java.util.Scanner; Scanner java.util class Main{
    public static void main(String[] args) {
        //入力
        Scanner scn=new Scanner(System.in);
        int[] time=new int[5];
        for(int i=0;i<5;i++){
            time[i]=scn.nextInt();
        }
        //処理
        int min_no1=9;
        int place=0;
        int cnt=0;
        int total=0;
        for(int i=0;i<5;i++){
            if(time[i]%10!=0){
                if( min_no1>time[i]%10) {
                    min_no1=time[i]%10;
                    place=i;
                }
            }else{
                cnt++;
            }
        }
        if(cnt==5)min_no1=0; 

        for(int i=0;i<5;i++){
            if(time[i]%10==0||place==i){
                total+=time[i];
            }else{
                total+=time[i]-time[i]%10+10;
            }
        }
        //出力
        System.out.println(total);
    }
} Main public static void main(String[] args) {
        //入力
        Scanner scn=new Scanner(System.in);
        int[] time=new int[5];
        for(int i=0;i<5;i++){
            time[i]=scn.nextInt();
        }
        //処理
        int min_no1=9;
        int place=0;
        int cnt=0;
        int total=0;
        for(int i=0;i<5;i++){
            if(time[i]%10!=0){
                if( min_no1>time[i]%10) {
                    min_no1=time[i]%10;
                    place=i;
                }
            }else{
                cnt++;
            }
        }
        if(cnt==5)min_no1=0; 

        for(int i=0;i<5;i++){
            if(time[i]%10==0||place==i){
                total+=time[i];
            }else{
                total+=time[i]-time[i]%10+10;
            }
        }
        //出力
        System.out.println(total);
    } main {
        //入力
        Scanner scn=new Scanner(System.in);
        int[] time=new int[5];
        for(int i=0;i<5;i++){
            time[i]=scn.nextInt();
        }
        //処理
        int min_no1=9;
        int place=0;
        int cnt=0;
        int total=0;
        for(int i=0;i<5;i++){
            if(time[i]%10!=0){
                if( min_no1>time[i]%10) {
                    min_no1=time[i]%10;
                    place=i;
                }
            }else{
                cnt++;
            }
        }
        if(cnt==5)min_no1=0; 

        for(int i=0;i<5;i++){
            if(time[i]%10==0||place==i){
                total+=time[i];
            }else{
                total+=time[i]-time[i]%10+10;
            }
        }
        //出力
        System.out.println(total);
    } Scanner scn=new Scanner(System.in); scn new Scanner(System.in) int[] time=new int[5]; time new int[5] 5 for(int i=0;i<5;i++){
            time[i]=scn.nextInt();
        } int i=0; int i=0; i 0 i<5 i 5 i++ i++ i {
            time[i]=scn.nextInt();
        } {
            time[i]=scn.nextInt();
        } time[i]=scn.nextInt() time[i] time i scn.nextInt() scn.nextInt scn int min_no1=9; min_no1 9 int place=0; place 0 int cnt=0; cnt 0 int total=0; total 0 for(int i=0;i<5;i++){
            if(time[i]%10!=0){
                if( min_no1>time[i]%10) {
                    min_no1=time[i]%10;
                    place=i;
                }
            }else{
                cnt++;
            }
        } int i=0; int i=0; i 0 i<5 i 5 i++ i++ i {
            if(time[i]%10!=0){
                if( min_no1>time[i]%10) {
                    min_no1=time[i]%10;
                    place=i;
                }
            }else{
                cnt++;
            }
        } {
            if(time[i]%10!=0){
                if( min_no1>time[i]%10) {
                    min_no1=time[i]%10;
                    place=i;
                }
            }else{
                cnt++;
            }
        } if(time[i]%10!=0){
                if( min_no1>time[i]%10) {
                    min_no1=time[i]%10;
                    place=i;
                }
            }else{
                cnt++;
            } time[i]%10!=0 time[i]%10 time[i] time i 10 0 {
                if( min_no1>time[i]%10) {
                    min_no1=time[i]%10;
                    place=i;
                }
            } if( min_no1>time[i]%10) {
                    min_no1=time[i]%10;
                    place=i;
                } min_no1>time[i]%10 min_no1 time[i]%10 time[i] time i 10 {
                    min_no1=time[i]%10;
                    place=i;
                } min_no1=time[i]%10 min_no1 time[i]%10 time[i] time i 10 place=i place i {
                cnt++;
            } cnt++ cnt if(cnt==5)min_no1=0; cnt==5 cnt 5 min_no1=0 min_no1 0 for(int i=0;i<5;i++){
            if(time[i]%10==0||place==i){
                total+=time[i];
            }else{
                total+=time[i]-time[i]%10+10;
            }
        } int i=0; int i=0; i 0 i<5 i 5 i++ i++ i {
            if(time[i]%10==0||place==i){
                total+=time[i];
            }else{
                total+=time[i]-time[i]%10+10;
            }
        } {
            if(time[i]%10==0||place==i){
                total+=time[i];
            }else{
                total+=time[i]-time[i]%10+10;
            }
        } if(time[i]%10==0||place==i){
                total+=time[i];
            }else{
                total+=time[i]-time[i]%10+10;
            } time[i]%10==0||place==i time[i]%10==0 time[i]%10 time[i] time i 10 0 place==i place i {
                total+=time[i];
            } total+=time[i] total time[i] time i {
                total+=time[i]-time[i]%10+10;
            } total+=time[i]-time[i]%10+10 total time[i]-time[i]%10+10 time[i]-time[i]%10 time[i] time i time[i]%10 time[i] time i 10 10 System.out.println(total) System.out.println System.out System System.out total String[] args args
import java.util.Scanner;
class Main{
    public static void main(String[] args) {
        //入力
        Scanner scn=new Scanner(System.in);
        int[] time=new int[5];
        for(int i=0;i<5;i++){
            time[i]=scn.nextInt();
        }
        //処理
        int min_no1=9;
        int place=0;
        int cnt=0;
        int total=0;
        for(int i=0;i<5;i++){
            if(time[i]%10!=0){
                if( min_no1>time[i]%10) {
                    min_no1=time[i]%10;
                    place=i;
                }
            }else{
                cnt++;
            }
        }
        if(cnt==5)min_no1=0; 

        for(int i=0;i<5;i++){
            if(time[i]%10==0||place==i){
                total+=time[i];
            }else{
                total+=time[i]-time[i]%10+10;
            }
        }
        //出力
        System.out.println(total);
    }
}
