
import java.util.*;

public class Main {
    public static void main(String[] args) throws Exception {
        Scanner sc = new Scanner(System.in);
        int[] a = new int[5];
        for(int i=0;i<5;i++){
            a[i] = sc.nextInt();
        }
        int min = 10;
        for(int i=0;i<5;i++){
            int tmp = a[i]%10;
            if(tmp==0){
            }
            else{
                if(tmp<min){min=tmp;}
                a[i] = (int)a[i]/10;
                a[i]++;
                a[i]*=10;
            }
        }
        int result = 0;
        for(int i=0;i<5;i++){
            result += a[i];
        }
        System.out.println(result-10+min);
    }
} import java.util.*; util.* java public class Main {
    public static void main(String[] args) throws Exception {
        Scanner sc = new Scanner(System.in);
        int[] a = new int[5];
        for(int i=0;i<5;i++){
            a[i] = sc.nextInt();
        }
        int min = 10;
        for(int i=0;i<5;i++){
            int tmp = a[i]%10;
            if(tmp==0){
            }
            else{
                if(tmp<min){min=tmp;}
                a[i] = (int)a[i]/10;
                a[i]++;
                a[i]*=10;
            }
        }
        int result = 0;
        for(int i=0;i<5;i++){
            result += a[i];
        }
        System.out.println(result-10+min);
    }
} Main public static void main(String[] args) throws Exception {
        Scanner sc = new Scanner(System.in);
        int[] a = new int[5];
        for(int i=0;i<5;i++){
            a[i] = sc.nextInt();
        }
        int min = 10;
        for(int i=0;i<5;i++){
            int tmp = a[i]%10;
            if(tmp==0){
            }
            else{
                if(tmp<min){min=tmp;}
                a[i] = (int)a[i]/10;
                a[i]++;
                a[i]*=10;
            }
        }
        int result = 0;
        for(int i=0;i<5;i++){
            result += a[i];
        }
        System.out.println(result-10+min);
    } main {
        Scanner sc = new Scanner(System.in);
        int[] a = new int[5];
        for(int i=0;i<5;i++){
            a[i] = sc.nextInt();
        }
        int min = 10;
        for(int i=0;i<5;i++){
            int tmp = a[i]%10;
            if(tmp==0){
            }
            else{
                if(tmp<min){min=tmp;}
                a[i] = (int)a[i]/10;
                a[i]++;
                a[i]*=10;
            }
        }
        int result = 0;
        for(int i=0;i<5;i++){
            result += a[i];
        }
        System.out.println(result-10+min);
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int[] a = new int[5]; a new int[5] 5 for(int i=0;i<5;i++){
            a[i] = sc.nextInt();
        } int i=0; int i=0; i 0 i<5 i 5 i++ i++ i {
            a[i] = sc.nextInt();
        } {
            a[i] = sc.nextInt();
        } a[i] = sc.nextInt() a[i] a i sc.nextInt() sc.nextInt sc int min = 10; min 10 for(int i=0;i<5;i++){
            int tmp = a[i]%10;
            if(tmp==0){
            }
            else{
                if(tmp<min){min=tmp;}
                a[i] = (int)a[i]/10;
                a[i]++;
                a[i]*=10;
            }
        } int i=0; int i=0; i 0 i<5 i 5 i++ i++ i {
            int tmp = a[i]%10;
            if(tmp==0){
            }
            else{
                if(tmp<min){min=tmp;}
                a[i] = (int)a[i]/10;
                a[i]++;
                a[i]*=10;
            }
        } {
            int tmp = a[i]%10;
            if(tmp==0){
            }
            else{
                if(tmp<min){min=tmp;}
                a[i] = (int)a[i]/10;
                a[i]++;
                a[i]*=10;
            }
        } int tmp = a[i]%10; tmp a[i]%10 a[i] a i 10 if(tmp==0){
            }
            else{
                if(tmp<min){min=tmp;}
                a[i] = (int)a[i]/10;
                a[i]++;
                a[i]*=10;
            } tmp==0 tmp 0 {
            } {
                if(tmp<min){min=tmp;}
                a[i] = (int)a[i]/10;
                a[i]++;
                a[i]*=10;
            } if(tmp<min){min=tmp;} tmp<min tmp min {min=tmp;} min=tmp min tmp a[i] = (int)a[i]/10 a[i] a i (int)a[i]/10 (int)a[i] a i 10 a[i]++ a[i] a i a[i]*=10 a[i] a i 10 int result = 0; result 0 for(int i=0;i<5;i++){
            result += a[i];
        } int i=0; int i=0; i 0 i<5 i 5 i++ i++ i {
            result += a[i];
        } {
            result += a[i];
        } result += a[i] result a[i] a i System.out.println(result-10+min) System.out.println System.out System System.out result-10+min result-10 result 10 min String[] args args public class Main {
    public static void main(String[] args) throws Exception {
        Scanner sc = new Scanner(System.in);
        int[] a = new int[5];
        for(int i=0;i<5;i++){
            a[i] = sc.nextInt();
        }
        int min = 10;
        for(int i=0;i<5;i++){
            int tmp = a[i]%10;
            if(tmp==0){
            }
            else{
                if(tmp<min){min=tmp;}
                a[i] = (int)a[i]/10;
                a[i]++;
                a[i]*=10;
            }
        }
        int result = 0;
        for(int i=0;i<5;i++){
            result += a[i];
        }
        System.out.println(result-10+min);
    }
} public class Main {
    public static void main(String[] args) throws Exception {
        Scanner sc = new Scanner(System.in);
        int[] a = new int[5];
        for(int i=0;i<5;i++){
            a[i] = sc.nextInt();
        }
        int min = 10;
        for(int i=0;i<5;i++){
            int tmp = a[i]%10;
            if(tmp==0){
            }
            else{
                if(tmp<min){min=tmp;}
                a[i] = (int)a[i]/10;
                a[i]++;
                a[i]*=10;
            }
        }
        int result = 0;
        for(int i=0;i<5;i++){
            result += a[i];
        }
        System.out.println(result-10+min);
    }
} Main

import java.util.*;

public class Main {
    public static void main(String[] args) throws Exception {
        Scanner sc = new Scanner(System.in);
        int[] a = new int[5];
        for(int i=0;i<5;i++){
            a[i] = sc.nextInt();
        }
        int min = 10;
        for(int i=0;i<5;i++){
            int tmp = a[i]%10;
            if(tmp==0){
            }
            else{
                if(tmp<min){min=tmp;}
                a[i] = (int)a[i]/10;
                a[i]++;
                a[i]*=10;
            }
        }
        int result = 0;
        for(int i=0;i<5;i++){
            result += a[i];
        }
        System.out.println(result-10+min);
    }
}