import java.util.*;
import static java.lang.Math.*;

public class Main {

    public static void main(String[] args) {

        Scanner scan = new Scanner(System.in);

        int[] time = new int[5];
        for(int i = 0; i < 5; i++){
            time[i] = scan.nextInt();
        }

        int[] time2 = new int[5];
        for(int i = 0; i < 5; i++){
            time2[i] = (int)ceil( (double)(time[i])/10.0 ) * 10;
        }


        int max = 0;
        int count = 0;
        int tmp =0;
        for(int i = 0; i < 5; i++){

            tmp = time2[i]-time[i];
            if(max <= tmp){
                max = tmp;
                count = i;
            }
        }

        int ans = 0;
        for(int i = 0; i < 5; i++) {

            if(i == count){

                ans += time[i];

            }else{

                ans += time2[i];
            }
        }

        System.out.println(ans);
    }
} import java.util.*; util.* java import static java.lang.Math.*; import static java.lang.Math.*; import static java.lang.Math.*; public class Main {

    public static void main(String[] args) {

        Scanner scan = new Scanner(System.in);

        int[] time = new int[5];
        for(int i = 0; i < 5; i++){
            time[i] = scan.nextInt();
        }

        int[] time2 = new int[5];
        for(int i = 0; i < 5; i++){
            time2[i] = (int)ceil( (double)(time[i])/10.0 ) * 10;
        }


        int max = 0;
        int count = 0;
        int tmp =0;
        for(int i = 0; i < 5; i++){

            tmp = time2[i]-time[i];
            if(max <= tmp){
                max = tmp;
                count = i;
            }
        }

        int ans = 0;
        for(int i = 0; i < 5; i++) {

            if(i == count){

                ans += time[i];

            }else{

                ans += time2[i];
            }
        }

        System.out.println(ans);
    }
} Main public static void main(String[] args) {

        Scanner scan = new Scanner(System.in);

        int[] time = new int[5];
        for(int i = 0; i < 5; i++){
            time[i] = scan.nextInt();
        }

        int[] time2 = new int[5];
        for(int i = 0; i < 5; i++){
            time2[i] = (int)ceil( (double)(time[i])/10.0 ) * 10;
        }


        int max = 0;
        int count = 0;
        int tmp =0;
        for(int i = 0; i < 5; i++){

            tmp = time2[i]-time[i];
            if(max <= tmp){
                max = tmp;
                count = i;
            }
        }

        int ans = 0;
        for(int i = 0; i < 5; i++) {

            if(i == count){

                ans += time[i];

            }else{

                ans += time2[i];
            }
        }

        System.out.println(ans);
    } main {

        Scanner scan = new Scanner(System.in);

        int[] time = new int[5];
        for(int i = 0; i < 5; i++){
            time[i] = scan.nextInt();
        }

        int[] time2 = new int[5];
        for(int i = 0; i < 5; i++){
            time2[i] = (int)ceil( (double)(time[i])/10.0 ) * 10;
        }


        int max = 0;
        int count = 0;
        int tmp =0;
        for(int i = 0; i < 5; i++){

            tmp = time2[i]-time[i];
            if(max <= tmp){
                max = tmp;
                count = i;
            }
        }

        int ans = 0;
        for(int i = 0; i < 5; i++) {

            if(i == count){

                ans += time[i];

            }else{

                ans += time2[i];
            }
        }

        System.out.println(ans);
    } Scanner scan = new Scanner(System.in); scan new Scanner(System.in) int[] time = new int[5]; time new int[5] 5 for(int i = 0; i < 5; i++){
            time[i] = scan.nextInt();
        } int i = 0; int i = 0; i 0 i < 5 i 5 i++ i++ i {
            time[i] = scan.nextInt();
        } {
            time[i] = scan.nextInt();
        } time[i] = scan.nextInt() time[i] time i scan.nextInt() scan.nextInt scan int[] time2 = new int[5]; time2 new int[5] 5 for(int i = 0; i < 5; i++){
            time2[i] = (int)ceil( (double)(time[i])/10.0 ) * 10;
        } int i = 0; int i = 0; i 0 i < 5 i 5 i++ i++ i {
            time2[i] = (int)ceil( (double)(time[i])/10.0 ) * 10;
        } {
            time2[i] = (int)ceil( (double)(time[i])/10.0 ) * 10;
        } time2[i] = (int)ceil( (double)(time[i])/10.0 ) * 10 time2[i] time2 i (int)ceil( (double)(time[i])/10.0 ) * 10 (int)ceil( (double)(time[i])/10.0 ) ceil (double)(time[i])/10.0 (double)(time[i]) time i 10.0 10 int max = 0; max 0 int count = 0; count 0 int tmp =0; tmp 0 for(int i = 0; i < 5; i++){

            tmp = time2[i]-time[i];
            if(max <= tmp){
                max = tmp;
                count = i;
            }
        } int i = 0; int i = 0; i 0 i < 5 i 5 i++ i++ i {

            tmp = time2[i]-time[i];
            if(max <= tmp){
                max = tmp;
                count = i;
            }
        } {

            tmp = time2[i]-time[i];
            if(max <= tmp){
                max = tmp;
                count = i;
            }
        } tmp = time2[i]-time[i] tmp time2[i]-time[i] time2[i] time2 i time[i] time i if(max <= tmp){
                max = tmp;
                count = i;
            } max <= tmp max tmp {
                max = tmp;
                count = i;
            } max = tmp max tmp count = i count i int ans = 0; ans 0 for(int i = 0; i < 5; i++) {

            if(i == count){

                ans += time[i];

            }else{

                ans += time2[i];
            }
        } int i = 0; int i = 0; i 0 i < 5 i 5 i++ i++ i {

            if(i == count){

                ans += time[i];

            }else{

                ans += time2[i];
            }
        } {

            if(i == count){

                ans += time[i];

            }else{

                ans += time2[i];
            }
        } if(i == count){

                ans += time[i];

            }else{

                ans += time2[i];
            } i == count i count {

                ans += time[i];

            } ans += time[i] ans time[i] time i {

                ans += time2[i];
            } ans += time2[i] ans time2[i] time2 i System.out.println(ans) System.out.println System.out System System.out ans String[] args args public class Main {

    public static void main(String[] args) {

        Scanner scan = new Scanner(System.in);

        int[] time = new int[5];
        for(int i = 0; i < 5; i++){
            time[i] = scan.nextInt();
        }

        int[] time2 = new int[5];
        for(int i = 0; i < 5; i++){
            time2[i] = (int)ceil( (double)(time[i])/10.0 ) * 10;
        }


        int max = 0;
        int count = 0;
        int tmp =0;
        for(int i = 0; i < 5; i++){

            tmp = time2[i]-time[i];
            if(max <= tmp){
                max = tmp;
                count = i;
            }
        }

        int ans = 0;
        for(int i = 0; i < 5; i++) {

            if(i == count){

                ans += time[i];

            }else{

                ans += time2[i];
            }
        }

        System.out.println(ans);
    }
} public class Main {

    public static void main(String[] args) {

        Scanner scan = new Scanner(System.in);

        int[] time = new int[5];
        for(int i = 0; i < 5; i++){
            time[i] = scan.nextInt();
        }

        int[] time2 = new int[5];
        for(int i = 0; i < 5; i++){
            time2[i] = (int)ceil( (double)(time[i])/10.0 ) * 10;
        }


        int max = 0;
        int count = 0;
        int tmp =0;
        for(int i = 0; i < 5; i++){

            tmp = time2[i]-time[i];
            if(max <= tmp){
                max = tmp;
                count = i;
            }
        }

        int ans = 0;
        for(int i = 0; i < 5; i++) {

            if(i == count){

                ans += time[i];

            }else{

                ans += time2[i];
            }
        }

        System.out.println(ans);
    }
} Main
import java.util.*;
import static java.lang.Math.*;

public class Main {

    public static void main(String[] args) {

        Scanner scan = new Scanner(System.in);

        int[] time = new int[5];
        for(int i = 0; i < 5; i++){
            time[i] = scan.nextInt();
        }

        int[] time2 = new int[5];
        for(int i = 0; i < 5; i++){
            time2[i] = (int)ceil( (double)(time[i])/10.0 ) * 10;
        }


        int max = 0;
        int count = 0;
        int tmp =0;
        for(int i = 0; i < 5; i++){

            tmp = time2[i]-time[i];
            if(max <= tmp){
                max = tmp;
                count = i;
            }
        }

        int ans = 0;
        for(int i = 0; i < 5; i++) {

            if(i == count){

                ans += time[i];

            }else{

                ans += time2[i];
            }
        }

        System.out.println(ans);
    }
}