import java.util.*;
public class Main {
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
        int[] a = new int[5];
        int min = 10;
        int minMenu = 0;
        int result = 0;
        for(int i=0;i<5;i++){
            a[i] = sc.nextInt();
            int mod = a[i] % 10;
            if(mod < min && mod != 0){
              min=mod;
              minMenu = i;
            }
        }
        for(int i=0;i<5;i++){
            if(i != minMenu){
              result += Math.ceil((float)a[i]/10)*10;
              
            }else{
              result += a[i];
            }
        }
        System.out.println(result);   
	}
} 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 min = 10;
        int minMenu = 0;
        int result = 0;
        for(int i=0;i<5;i++){
            a[i] = sc.nextInt();
            int mod = a[i] % 10;
            if(mod < min && mod != 0){
              min=mod;
              minMenu = i;
            }
        }
        for(int i=0;i<5;i++){
            if(i != minMenu){
              result += Math.ceil((float)a[i]/10)*10;
              
            }else{
              result += a[i];
            }
        }
        System.out.println(result);   
	}
} Main public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
        int[] a = new int[5];
        int min = 10;
        int minMenu = 0;
        int result = 0;
        for(int i=0;i<5;i++){
            a[i] = sc.nextInt();
            int mod = a[i] % 10;
            if(mod < min && mod != 0){
              min=mod;
              minMenu = i;
            }
        }
        for(int i=0;i<5;i++){
            if(i != minMenu){
              result += Math.ceil((float)a[i]/10)*10;
              
            }else{
              result += a[i];
            }
        }
        System.out.println(result);   
	} main {
		Scanner sc = new Scanner(System.in);
        int[] a = new int[5];
        int min = 10;
        int minMenu = 0;
        int result = 0;
        for(int i=0;i<5;i++){
            a[i] = sc.nextInt();
            int mod = a[i] % 10;
            if(mod < min && mod != 0){
              min=mod;
              minMenu = i;
            }
        }
        for(int i=0;i<5;i++){
            if(i != minMenu){
              result += Math.ceil((float)a[i]/10)*10;
              
            }else{
              result += a[i];
            }
        }
        System.out.println(result);   
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int[] a = new int[5]; a new int[5] 5 int min = 10; min 10 int minMenu = 0; minMenu 0 int result = 0; result 0 for(int i=0;i<5;i++){
            a[i] = sc.nextInt();
            int mod = a[i] % 10;
            if(mod < min && mod != 0){
              min=mod;
              minMenu = i;
            }
        } int i=0; int i=0; i 0 i<5 i 5 i++ i++ i {
            a[i] = sc.nextInt();
            int mod = a[i] % 10;
            if(mod < min && mod != 0){
              min=mod;
              minMenu = i;
            }
        } {
            a[i] = sc.nextInt();
            int mod = a[i] % 10;
            if(mod < min && mod != 0){
              min=mod;
              minMenu = i;
            }
        } a[i] = sc.nextInt() a[i] a i sc.nextInt() sc.nextInt sc int mod = a[i] % 10; mod a[i] % 10 a[i] a i 10 if(mod < min && mod != 0){
              min=mod;
              minMenu = i;
            } mod < min && mod != 0 mod < min mod min mod != 0 mod 0 {
              min=mod;
              minMenu = i;
            } min=mod min mod minMenu = i minMenu i for(int i=0;i<5;i++){
            if(i != minMenu){
              result += Math.ceil((float)a[i]/10)*10;
              
            }else{
              result += a[i];
            }
        } int i=0; int i=0; i 0 i<5 i 5 i++ i++ i {
            if(i != minMenu){
              result += Math.ceil((float)a[i]/10)*10;
              
            }else{
              result += a[i];
            }
        } {
            if(i != minMenu){
              result += Math.ceil((float)a[i]/10)*10;
              
            }else{
              result += a[i];
            }
        } if(i != minMenu){
              result += Math.ceil((float)a[i]/10)*10;
              
            }else{
              result += a[i];
            } i != minMenu i minMenu {
              result += Math.ceil((float)a[i]/10)*10;
              
            } result += Math.ceil((float)a[i]/10)*10 result Math.ceil((float)a[i]/10)*10 Math.ceil((float)a[i]/10) Math.ceil Math (float)a[i]/10 (float)a[i] a i 10 10 {
              result += a[i];
            } result += a[i] result a[i] a i System.out.println(result) System.out.println System.out System System.out result String[] args args public class Main {
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
        int[] a = new int[5];
        int min = 10;
        int minMenu = 0;
        int result = 0;
        for(int i=0;i<5;i++){
            a[i] = sc.nextInt();
            int mod = a[i] % 10;
            if(mod < min && mod != 0){
              min=mod;
              minMenu = i;
            }
        }
        for(int i=0;i<5;i++){
            if(i != minMenu){
              result += Math.ceil((float)a[i]/10)*10;
              
            }else{
              result += a[i];
            }
        }
        System.out.println(result);   
	}
} public class Main {
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
        int[] a = new int[5];
        int min = 10;
        int minMenu = 0;
        int result = 0;
        for(int i=0;i<5;i++){
            a[i] = sc.nextInt();
            int mod = a[i] % 10;
            if(mod < min && mod != 0){
              min=mod;
              minMenu = i;
            }
        }
        for(int i=0;i<5;i++){
            if(i != minMenu){
              result += Math.ceil((float)a[i]/10)*10;
              
            }else{
              result += a[i];
            }
        }
        System.out.println(result);   
	}
} 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 min = 10;
        int minMenu = 0;
        int result = 0;
        for(int i=0;i<5;i++){
            a[i] = sc.nextInt();
            int mod = a[i] % 10;
            if(mod < min && mod != 0){
              min=mod;
              minMenu = i;
            }
        }
        for(int i=0;i<5;i++){
            if(i != minMenu){
              result += Math.ceil((float)a[i]/10)*10;
              
            }else{
              result += a[i];
            }
        }
        System.out.println(result);   
	}
}