

import java.util.Scanner;

public class Main {

    public static void main(final String[] args) {

        try (final Scanner sc = new Scanner(System.in)) {
            final int[] nums = new int[5];
            for (int i = 0; i < nums.length; i++) {
                nums[i] = sc.nextInt();
            }
            int result = 0;
            int maxPad = 0;
            for (int i = 0; i < nums.length; i++) {
                int pad = nums[i] % 10 == 0 ? 0 : 10 - (nums[i] % 10);
                maxPad = Math.max(maxPad, pad);
                result += nums[i] + pad;
            }
            result -= maxPad;
            System.out.println(result);
        }
    }
} import java.util.Scanner; Scanner java.util public class Main {

    public static void main(final String[] args) {

        try (final Scanner sc = new Scanner(System.in)) {
            final int[] nums = new int[5];
            for (int i = 0; i < nums.length; i++) {
                nums[i] = sc.nextInt();
            }
            int result = 0;
            int maxPad = 0;
            for (int i = 0; i < nums.length; i++) {
                int pad = nums[i] % 10 == 0 ? 0 : 10 - (nums[i] % 10);
                maxPad = Math.max(maxPad, pad);
                result += nums[i] + pad;
            }
            result -= maxPad;
            System.out.println(result);
        }
    }
} Main public static void main(final String[] args) {

        try (final Scanner sc = new Scanner(System.in)) {
            final int[] nums = new int[5];
            for (int i = 0; i < nums.length; i++) {
                nums[i] = sc.nextInt();
            }
            int result = 0;
            int maxPad = 0;
            for (int i = 0; i < nums.length; i++) {
                int pad = nums[i] % 10 == 0 ? 0 : 10 - (nums[i] % 10);
                maxPad = Math.max(maxPad, pad);
                result += nums[i] + pad;
            }
            result -= maxPad;
            System.out.println(result);
        }
    } main {

        try (final Scanner sc = new Scanner(System.in)) {
            final int[] nums = new int[5];
            for (int i = 0; i < nums.length; i++) {
                nums[i] = sc.nextInt();
            }
            int result = 0;
            int maxPad = 0;
            for (int i = 0; i < nums.length; i++) {
                int pad = nums[i] % 10 == 0 ? 0 : 10 - (nums[i] % 10);
                maxPad = Math.max(maxPad, pad);
                result += nums[i] + pad;
            }
            result -= maxPad;
            System.out.println(result);
        }
    } try (final Scanner sc = new Scanner(System.in)) {
            final int[] nums = new int[5];
            for (int i = 0; i < nums.length; i++) {
                nums[i] = sc.nextInt();
            }
            int result = 0;
            int maxPad = 0;
            for (int i = 0; i < nums.length; i++) {
                int pad = nums[i] % 10 == 0 ? 0 : 10 - (nums[i] % 10);
                maxPad = Math.max(maxPad, pad);
                result += nums[i] + pad;
            }
            result -= maxPad;
            System.out.println(result);
        } {
            final int[] nums = new int[5];
            for (int i = 0; i < nums.length; i++) {
                nums[i] = sc.nextInt();
            }
            int result = 0;
            int maxPad = 0;
            for (int i = 0; i < nums.length; i++) {
                int pad = nums[i] % 10 == 0 ? 0 : 10 - (nums[i] % 10);
                maxPad = Math.max(maxPad, pad);
                result += nums[i] + pad;
            }
            result -= maxPad;
            System.out.println(result);
        } final Scanner sc = new Scanner(System.in) final Scanner sc = new Scanner(System.in) new Scanner(System.in) final int[] nums = new int[5]; nums new int[5] 5 for (int i = 0; i < nums.length; i++) {
                nums[i] = sc.nextInt();
            } int i = 0; int i = 0; i 0 i < nums.length i nums.length nums nums.length i++ i++ i {
                nums[i] = sc.nextInt();
            } {
                nums[i] = sc.nextInt();
            } nums[i] = sc.nextInt() nums[i] nums i sc.nextInt() sc.nextInt sc int result = 0; result 0 int maxPad = 0; maxPad 0 for (int i = 0; i < nums.length; i++) {
                int pad = nums[i] % 10 == 0 ? 0 : 10 - (nums[i] % 10);
                maxPad = Math.max(maxPad, pad);
                result += nums[i] + pad;
            } int i = 0; int i = 0; i 0 i < nums.length i nums.length nums nums.length i++ i++ i {
                int pad = nums[i] % 10 == 0 ? 0 : 10 - (nums[i] % 10);
                maxPad = Math.max(maxPad, pad);
                result += nums[i] + pad;
            } {
                int pad = nums[i] % 10 == 0 ? 0 : 10 - (nums[i] % 10);
                maxPad = Math.max(maxPad, pad);
                result += nums[i] + pad;
            } int pad = nums[i] % 10 == 0 ? 0 : 10 - (nums[i] % 10); pad nums[i] % 10 == 0 ? 0 : 10 - (nums[i] % 10) nums[i] % 10 == 0 nums[i] % 10 nums[i] nums i 10 0 0 10 - (nums[i] % 10) 10 (nums[i] % 10) nums[i] nums i 10 maxPad = Math.max(maxPad, pad) maxPad Math.max(maxPad, pad) Math.max Math maxPad pad result += nums[i] + pad result nums[i] + pad nums[i] nums i pad result -= maxPad result maxPad System.out.println(result) System.out.println System.out System System.out result final String[] args args public class Main {

    public static void main(final String[] args) {

        try (final Scanner sc = new Scanner(System.in)) {
            final int[] nums = new int[5];
            for (int i = 0; i < nums.length; i++) {
                nums[i] = sc.nextInt();
            }
            int result = 0;
            int maxPad = 0;
            for (int i = 0; i < nums.length; i++) {
                int pad = nums[i] % 10 == 0 ? 0 : 10 - (nums[i] % 10);
                maxPad = Math.max(maxPad, pad);
                result += nums[i] + pad;
            }
            result -= maxPad;
            System.out.println(result);
        }
    }
} public class Main {

    public static void main(final String[] args) {

        try (final Scanner sc = new Scanner(System.in)) {
            final int[] nums = new int[5];
            for (int i = 0; i < nums.length; i++) {
                nums[i] = sc.nextInt();
            }
            int result = 0;
            int maxPad = 0;
            for (int i = 0; i < nums.length; i++) {
                int pad = nums[i] % 10 == 0 ? 0 : 10 - (nums[i] % 10);
                maxPad = Math.max(maxPad, pad);
                result += nums[i] + pad;
            }
            result -= maxPad;
            System.out.println(result);
        }
    }
} Main


import java.util.Scanner;

public class Main {

    public static void main(final String[] args) {

        try (final Scanner sc = new Scanner(System.in)) {
            final int[] nums = new int[5];
            for (int i = 0; i < nums.length; i++) {
                nums[i] = sc.nextInt();
            }
            int result = 0;
            int maxPad = 0;
            for (int i = 0; i < nums.length; i++) {
                int pad = nums[i] % 10 == 0 ? 0 : 10 - (nums[i] % 10);
                maxPad = Math.max(maxPad, pad);
                result += nums[i] + pad;
            }
            result -= maxPad;
            System.out.println(result);
        }
    }
}
