import java.util.Scanner;

class Main {
    public static void main(final String[] args) {
        Scanner scan = new Scanner(System.in);
        int[] in = new int[5];
        in[0] = scan.nextInt();
        in[1] = scan.nextInt();
        in[2] = scan.nextInt();
        in[3] = scan.nextInt();
        in[4] = scan.nextInt();

        int sum = 0;
        int max = 0;
        for (int i = 0; i < in.length; i++) {
            sum +=Math.round((int)Math.ceil((double)in[i]/10) * 10);
            if (10-in[i]%10 == 10) {
                continue;
            }
            max = Math.max(max,10-in[i]%10);
        }
        System.out.println(sum - max);
    }
} import java.util.Scanner; Scanner java.util class Main {
    public static void main(final String[] args) {
        Scanner scan = new Scanner(System.in);
        int[] in = new int[5];
        in[0] = scan.nextInt();
        in[1] = scan.nextInt();
        in[2] = scan.nextInt();
        in[3] = scan.nextInt();
        in[4] = scan.nextInt();

        int sum = 0;
        int max = 0;
        for (int i = 0; i < in.length; i++) {
            sum +=Math.round((int)Math.ceil((double)in[i]/10) * 10);
            if (10-in[i]%10 == 10) {
                continue;
            }
            max = Math.max(max,10-in[i]%10);
        }
        System.out.println(sum - max);
    }
} Main public static void main(final String[] args) {
        Scanner scan = new Scanner(System.in);
        int[] in = new int[5];
        in[0] = scan.nextInt();
        in[1] = scan.nextInt();
        in[2] = scan.nextInt();
        in[3] = scan.nextInt();
        in[4] = scan.nextInt();

        int sum = 0;
        int max = 0;
        for (int i = 0; i < in.length; i++) {
            sum +=Math.round((int)Math.ceil((double)in[i]/10) * 10);
            if (10-in[i]%10 == 10) {
                continue;
            }
            max = Math.max(max,10-in[i]%10);
        }
        System.out.println(sum - max);
    } main {
        Scanner scan = new Scanner(System.in);
        int[] in = new int[5];
        in[0] = scan.nextInt();
        in[1] = scan.nextInt();
        in[2] = scan.nextInt();
        in[3] = scan.nextInt();
        in[4] = scan.nextInt();

        int sum = 0;
        int max = 0;
        for (int i = 0; i < in.length; i++) {
            sum +=Math.round((int)Math.ceil((double)in[i]/10) * 10);
            if (10-in[i]%10 == 10) {
                continue;
            }
            max = Math.max(max,10-in[i]%10);
        }
        System.out.println(sum - max);
    } Scanner scan = new Scanner(System.in); scan new Scanner(System.in) int[] in = new int[5]; in new int[5] 5 in[0] = scan.nextInt() in[0] in 0 scan.nextInt() scan.nextInt scan in[1] = scan.nextInt() in[1] in 1 scan.nextInt() scan.nextInt scan in[2] = scan.nextInt() in[2] in 2 scan.nextInt() scan.nextInt scan in[3] = scan.nextInt() in[3] in 3 scan.nextInt() scan.nextInt scan in[4] = scan.nextInt() in[4] in 4 scan.nextInt() scan.nextInt scan int sum = 0; sum 0 int max = 0; max 0 for (int i = 0; i < in.length; i++) {
            sum +=Math.round((int)Math.ceil((double)in[i]/10) * 10);
            if (10-in[i]%10 == 10) {
                continue;
            }
            max = Math.max(max,10-in[i]%10);
        } int i = 0; int i = 0; i 0 i < in.length i in.length in in.length i++ i++ i {
            sum +=Math.round((int)Math.ceil((double)in[i]/10) * 10);
            if (10-in[i]%10 == 10) {
                continue;
            }
            max = Math.max(max,10-in[i]%10);
        } {
            sum +=Math.round((int)Math.ceil((double)in[i]/10) * 10);
            if (10-in[i]%10 == 10) {
                continue;
            }
            max = Math.max(max,10-in[i]%10);
        } sum +=Math.round((int)Math.ceil((double)in[i]/10) * 10) sum Math.round((int)Math.ceil((double)in[i]/10) * 10) Math.round Math (int)Math.ceil((double)in[i]/10) * 10 (int)Math.ceil((double)in[i]/10) Math.ceil Math (double)in[i]/10 (double)in[i] in i 10 10 if (10-in[i]%10 == 10) {
                continue;
            } 10-in[i]%10 == 10 10-in[i]%10 10 in[i]%10 in[i] in i 10 10 {
                continue;
            } continue; max = Math.max(max,10-in[i]%10) max Math.max(max,10-in[i]%10) Math.max Math max 10-in[i]%10 10 in[i]%10 in[i] in i 10 System.out.println(sum - max) System.out.println System.out System System.out sum - max sum max final String[] args args
import java.util.Scanner;

class Main {
    public static void main(final String[] args) {
        Scanner scan = new Scanner(System.in);
        int[] in = new int[5];
        in[0] = scan.nextInt();
        in[1] = scan.nextInt();
        in[2] = scan.nextInt();
        in[3] = scan.nextInt();
        in[4] = scan.nextInt();

        int sum = 0;
        int max = 0;
        for (int i = 0; i < in.length; i++) {
            sum +=Math.round((int)Math.ceil((double)in[i]/10) * 10);
            if (10-in[i]%10 == 10) {
                continue;
            }
            max = Math.max(max,10-in[i]%10);
        }
        System.out.println(sum - max);
    }
}
