import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int ans = 0;
        int maxVari= 0;
        int last = 0 ;
        int lastval =0;
        for (int i = 0; i <5 ; i++) {
            int a  =sc.nextInt();
            int val = (int)Math.ceil( (double) a / 10) *10;
            if( val-a > maxVari){
                maxVari = val-a;
                last = a;
                lastval= val;
            }
            ans += val;
        }
        ans = ans -lastval +  last ;

            System.out.println(ans);
    }

} import java.util.Scanner; Scanner java.util public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int ans = 0;
        int maxVari= 0;
        int last = 0 ;
        int lastval =0;
        for (int i = 0; i <5 ; i++) {
            int a  =sc.nextInt();
            int val = (int)Math.ceil( (double) a / 10) *10;
            if( val-a > maxVari){
                maxVari = val-a;
                last = a;
                lastval= val;
            }
            ans += val;
        }
        ans = ans -lastval +  last ;

            System.out.println(ans);
    }

} Main public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int ans = 0;
        int maxVari= 0;
        int last = 0 ;
        int lastval =0;
        for (int i = 0; i <5 ; i++) {
            int a  =sc.nextInt();
            int val = (int)Math.ceil( (double) a / 10) *10;
            if( val-a > maxVari){
                maxVari = val-a;
                last = a;
                lastval= val;
            }
            ans += val;
        }
        ans = ans -lastval +  last ;

            System.out.println(ans);
    } main {
        Scanner sc = new Scanner(System.in);
        int ans = 0;
        int maxVari= 0;
        int last = 0 ;
        int lastval =0;
        for (int i = 0; i <5 ; i++) {
            int a  =sc.nextInt();
            int val = (int)Math.ceil( (double) a / 10) *10;
            if( val-a > maxVari){
                maxVari = val-a;
                last = a;
                lastval= val;
            }
            ans += val;
        }
        ans = ans -lastval +  last ;

            System.out.println(ans);
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int ans = 0; ans 0 int maxVari= 0; maxVari 0 int last = 0 ; last 0 int lastval =0; lastval 0 for (int i = 0; i <5 ; i++) {
            int a  =sc.nextInt();
            int val = (int)Math.ceil( (double) a / 10) *10;
            if( val-a > maxVari){
                maxVari = val-a;
                last = a;
                lastval= val;
            }
            ans += val;
        } int i = 0; int i = 0; i 0 i <5 i 5 i++ i++ i {
            int a  =sc.nextInt();
            int val = (int)Math.ceil( (double) a / 10) *10;
            if( val-a > maxVari){
                maxVari = val-a;
                last = a;
                lastval= val;
            }
            ans += val;
        } {
            int a  =sc.nextInt();
            int val = (int)Math.ceil( (double) a / 10) *10;
            if( val-a > maxVari){
                maxVari = val-a;
                last = a;
                lastval= val;
            }
            ans += val;
        } int a  =sc.nextInt(); a sc.nextInt() sc.nextInt sc int val = (int)Math.ceil( (double) a / 10) *10; val (int)Math.ceil( (double) a / 10) *10 (int)Math.ceil( (double) a / 10) Math.ceil Math (double) a / 10 (double) a 10 10 if( val-a > maxVari){
                maxVari = val-a;
                last = a;
                lastval= val;
            } val-a > maxVari val-a val a maxVari {
                maxVari = val-a;
                last = a;
                lastval= val;
            } maxVari = val-a maxVari val-a val a last = a last a lastval= val lastval val ans += val ans val ans = ans -lastval +  last ans ans -lastval +  last ans -lastval ans lastval last 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 sc = new Scanner(System.in);
        int ans = 0;
        int maxVari= 0;
        int last = 0 ;
        int lastval =0;
        for (int i = 0; i <5 ; i++) {
            int a  =sc.nextInt();
            int val = (int)Math.ceil( (double) a / 10) *10;
            if( val-a > maxVari){
                maxVari = val-a;
                last = a;
                lastval= val;
            }
            ans += val;
        }
        ans = ans -lastval +  last ;

            System.out.println(ans);
    }

} public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int ans = 0;
        int maxVari= 0;
        int last = 0 ;
        int lastval =0;
        for (int i = 0; i <5 ; i++) {
            int a  =sc.nextInt();
            int val = (int)Math.ceil( (double) a / 10) *10;
            if( val-a > maxVari){
                maxVari = val-a;
                last = a;
                lastval= val;
            }
            ans += val;
        }
        ans = ans -lastval +  last ;

            System.out.println(ans);
    }

} Main
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int ans = 0;
        int maxVari= 0;
        int last = 0 ;
        int lastval =0;
        for (int i = 0; i <5 ; i++) {
            int a  =sc.nextInt();
            int val = (int)Math.ceil( (double) a / 10) *10;
            if( val-a > maxVari){
                maxVari = val-a;
                last = a;
                lastval= val;
            }
            ans += val;
        }
        ans = ans -lastval +  last ;

            System.out.println(ans);
    }

}
