import java.util.*;
public class Main{
        public static void main(String[] args){
                Scanner sc = new Scanner(System.in);
                int[] a = new int[5];
                int last = 0;
                int[] b = new int[5];
                for(int i = 0 ; i < 5 ; i++){
                        a[i] = sc.nextInt();
                        if(a[i] % 10 == 0){
                                b[i] = 10;
                        }else{
                                b[i] = a[i] % 10;
                        }
                        if(b[last] > b[i]) last = i;
                }
                int yono = 0;
                yono += a[last];
                a[last] = 0;
                for(int i = 0 ; i < 5 ; i++){
                        a[i] = (int)Math.ceil(a[i] / 10.0);
                        a[i] *= 10;
                        yono += a[i];
                }
                System.out.println(yono);
        }
}//0=48
//鶏になれ 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 last = 0;
                int[] b = new int[5];
                for(int i = 0 ; i < 5 ; i++){
                        a[i] = sc.nextInt();
                        if(a[i] % 10 == 0){
                                b[i] = 10;
                        }else{
                                b[i] = a[i] % 10;
                        }
                        if(b[last] > b[i]) last = i;
                }
                int yono = 0;
                yono += a[last];
                a[last] = 0;
                for(int i = 0 ; i < 5 ; i++){
                        a[i] = (int)Math.ceil(a[i] / 10.0);
                        a[i] *= 10;
                        yono += a[i];
                }
                System.out.println(yono);
        }
}//0=48 Main public static void main(String[] args){
                Scanner sc = new Scanner(System.in);
                int[] a = new int[5];
                int last = 0;
                int[] b = new int[5];
                for(int i = 0 ; i < 5 ; i++){
                        a[i] = sc.nextInt();
                        if(a[i] % 10 == 0){
                                b[i] = 10;
                        }else{
                                b[i] = a[i] % 10;
                        }
                        if(b[last] > b[i]) last = i;
                }
                int yono = 0;
                yono += a[last];
                a[last] = 0;
                for(int i = 0 ; i < 5 ; i++){
                        a[i] = (int)Math.ceil(a[i] / 10.0);
                        a[i] *= 10;
                        yono += a[i];
                }
                System.out.println(yono);
        } main {
                Scanner sc = new Scanner(System.in);
                int[] a = new int[5];
                int last = 0;
                int[] b = new int[5];
                for(int i = 0 ; i < 5 ; i++){
                        a[i] = sc.nextInt();
                        if(a[i] % 10 == 0){
                                b[i] = 10;
                        }else{
                                b[i] = a[i] % 10;
                        }
                        if(b[last] > b[i]) last = i;
                }
                int yono = 0;
                yono += a[last];
                a[last] = 0;
                for(int i = 0 ; i < 5 ; i++){
                        a[i] = (int)Math.ceil(a[i] / 10.0);
                        a[i] *= 10;
                        yono += a[i];
                }
                System.out.println(yono);
        } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int[] a = new int[5]; a new int[5] 5 int last = 0; last 0 int[] b = new int[5]; b new int[5] 5 for(int i = 0 ; i < 5 ; i++){
                        a[i] = sc.nextInt();
                        if(a[i] % 10 == 0){
                                b[i] = 10;
                        }else{
                                b[i] = a[i] % 10;
                        }
                        if(b[last] > b[i]) last = i;
                } int i = 0 ; int i = 0 ; i 0 i < 5 i 5 i++ i++ i {
                        a[i] = sc.nextInt();
                        if(a[i] % 10 == 0){
                                b[i] = 10;
                        }else{
                                b[i] = a[i] % 10;
                        }
                        if(b[last] > b[i]) last = i;
                } {
                        a[i] = sc.nextInt();
                        if(a[i] % 10 == 0){
                                b[i] = 10;
                        }else{
                                b[i] = a[i] % 10;
                        }
                        if(b[last] > b[i]) last = i;
                } a[i] = sc.nextInt() a[i] a i sc.nextInt() sc.nextInt sc if(a[i] % 10 == 0){
                                b[i] = 10;
                        }else{
                                b[i] = a[i] % 10;
                        } a[i] % 10 == 0 a[i] % 10 a[i] a i 10 0 {
                                b[i] = 10;
                        } b[i] = 10 b[i] b i 10 {
                                b[i] = a[i] % 10;
                        } b[i] = a[i] % 10 b[i] b i a[i] % 10 a[i] a i 10 if(b[last] > b[i]) last = i; b[last] > b[i] b[last] b last b[i] b i last = i last i int yono = 0; yono 0 yono += a[last] yono a[last] a last a[last] = 0 a[last] a last 0 for(int i = 0 ; i < 5 ; i++){
                        a[i] = (int)Math.ceil(a[i] / 10.0);
                        a[i] *= 10;
                        yono += a[i];
                } int i = 0 ; int i = 0 ; i 0 i < 5 i 5 i++ i++ i {
                        a[i] = (int)Math.ceil(a[i] / 10.0);
                        a[i] *= 10;
                        yono += a[i];
                } {
                        a[i] = (int)Math.ceil(a[i] / 10.0);
                        a[i] *= 10;
                        yono += a[i];
                } a[i] = (int)Math.ceil(a[i] / 10.0) a[i] a i (int)Math.ceil(a[i] / 10.0) Math.ceil Math a[i] / 10.0 a[i] a i 10.0 a[i] *= 10 a[i] a i 10 yono += a[i] yono a[i] a i System.out.println(yono) System.out.println System.out System System.out yono String[] args args public class Main{
        public static void main(String[] args){
                Scanner sc = new Scanner(System.in);
                int[] a = new int[5];
                int last = 0;
                int[] b = new int[5];
                for(int i = 0 ; i < 5 ; i++){
                        a[i] = sc.nextInt();
                        if(a[i] % 10 == 0){
                                b[i] = 10;
                        }else{
                                b[i] = a[i] % 10;
                        }
                        if(b[last] > b[i]) last = i;
                }
                int yono = 0;
                yono += a[last];
                a[last] = 0;
                for(int i = 0 ; i < 5 ; i++){
                        a[i] = (int)Math.ceil(a[i] / 10.0);
                        a[i] *= 10;
                        yono += a[i];
                }
                System.out.println(yono);
        }
}//0=48 public class Main{
        public static void main(String[] args){
                Scanner sc = new Scanner(System.in);
                int[] a = new int[5];
                int last = 0;
                int[] b = new int[5];
                for(int i = 0 ; i < 5 ; i++){
                        a[i] = sc.nextInt();
                        if(a[i] % 10 == 0){
                                b[i] = 10;
                        }else{
                                b[i] = a[i] % 10;
                        }
                        if(b[last] > b[i]) last = i;
                }
                int yono = 0;
                yono += a[last];
                a[last] = 0;
                for(int i = 0 ; i < 5 ; i++){
                        a[i] = (int)Math.ceil(a[i] / 10.0);
                        a[i] *= 10;
                        yono += a[i];
                }
                System.out.println(yono);
        }
}//0=48 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 last = 0;
                int[] b = new int[5];
                for(int i = 0 ; i < 5 ; i++){
                        a[i] = sc.nextInt();
                        if(a[i] % 10 == 0){
                                b[i] = 10;
                        }else{
                                b[i] = a[i] % 10;
                        }
                        if(b[last] > b[i]) last = i;
                }
                int yono = 0;
                yono += a[last];
                a[last] = 0;
                for(int i = 0 ; i < 5 ; i++){
                        a[i] = (int)Math.ceil(a[i] / 10.0);
                        a[i] *= 10;
                        yono += a[i];
                }
                System.out.println(yono);
        }
}//0=48
//鶏になれ