

import java.util.Scanner;

public class Main {

    static Scanner sc = new Scanner(System.in);


    public static void main(String[] args) {
        int[] round = new int[5];
        int tempMin = 9;
        int index = -1;
        for (int i = 0; i < 5; i++) {
            int num = sc.nextInt();
            round[i] = (int) (Math.ceil((float) num / 10) * 10);
            if ((num % 10) <= (tempMin % 10) && num % 10 > 0) {
                tempMin = num;
                index = i;
            }
        }
        int sum = 0;
        for (int i = 0; i < 5; i++) {
            if (i != index) {
                sum += round[i];
            }
        }
        if (index >= 0) {
            sum += tempMin;
        }
        System.out.println(sum);
    }
} import java.util.Scanner; Scanner java.util public class Main {

    static Scanner sc = new Scanner(System.in);


    public static void main(String[] args) {
        int[] round = new int[5];
        int tempMin = 9;
        int index = -1;
        for (int i = 0; i < 5; i++) {
            int num = sc.nextInt();
            round[i] = (int) (Math.ceil((float) num / 10) * 10);
            if ((num % 10) <= (tempMin % 10) && num % 10 > 0) {
                tempMin = num;
                index = i;
            }
        }
        int sum = 0;
        for (int i = 0; i < 5; i++) {
            if (i != index) {
                sum += round[i];
            }
        }
        if (index >= 0) {
            sum += tempMin;
        }
        System.out.println(sum);
    }
} Main static Scanner sc = new Scanner(System.in); sc new Scanner(System.in) public static void main(String[] args) {
        int[] round = new int[5];
        int tempMin = 9;
        int index = -1;
        for (int i = 0; i < 5; i++) {
            int num = sc.nextInt();
            round[i] = (int) (Math.ceil((float) num / 10) * 10);
            if ((num % 10) <= (tempMin % 10) && num % 10 > 0) {
                tempMin = num;
                index = i;
            }
        }
        int sum = 0;
        for (int i = 0; i < 5; i++) {
            if (i != index) {
                sum += round[i];
            }
        }
        if (index >= 0) {
            sum += tempMin;
        }
        System.out.println(sum);
    } main {
        int[] round = new int[5];
        int tempMin = 9;
        int index = -1;
        for (int i = 0; i < 5; i++) {
            int num = sc.nextInt();
            round[i] = (int) (Math.ceil((float) num / 10) * 10);
            if ((num % 10) <= (tempMin % 10) && num % 10 > 0) {
                tempMin = num;
                index = i;
            }
        }
        int sum = 0;
        for (int i = 0; i < 5; i++) {
            if (i != index) {
                sum += round[i];
            }
        }
        if (index >= 0) {
            sum += tempMin;
        }
        System.out.println(sum);
    } int[] round = new int[5]; round new int[5] 5 int tempMin = 9; tempMin 9 int index = -1; index -1 1 for (int i = 0; i < 5; i++) {
            int num = sc.nextInt();
            round[i] = (int) (Math.ceil((float) num / 10) * 10);
            if ((num % 10) <= (tempMin % 10) && num % 10 > 0) {
                tempMin = num;
                index = i;
            }
        } int i = 0; int i = 0; i 0 i < 5 i 5 i++ i++ i {
            int num = sc.nextInt();
            round[i] = (int) (Math.ceil((float) num / 10) * 10);
            if ((num % 10) <= (tempMin % 10) && num % 10 > 0) {
                tempMin = num;
                index = i;
            }
        } {
            int num = sc.nextInt();
            round[i] = (int) (Math.ceil((float) num / 10) * 10);
            if ((num % 10) <= (tempMin % 10) && num % 10 > 0) {
                tempMin = num;
                index = i;
            }
        } int num = sc.nextInt(); num sc.nextInt() sc.nextInt sc round[i] = (int) (Math.ceil((float) num / 10) * 10) round[i] round i (int) (Math.ceil((float) num / 10) * 10) Math.ceil((float) num / 10) Math.ceil Math (float) num / 10 (float) num 10 10 if ((num % 10) <= (tempMin % 10) && num % 10 > 0) {
                tempMin = num;
                index = i;
            } (num % 10) <= (tempMin % 10) && num % 10 > 0 (num % 10) <= (tempMin % 10) (num % 10) num 10 (tempMin % 10) tempMin 10 num % 10 > 0 num % 10 num 10 0 {
                tempMin = num;
                index = i;
            } tempMin = num tempMin num index = i index i int sum = 0; sum 0 for (int i = 0; i < 5; i++) {
            if (i != index) {
                sum += round[i];
            }
        } int i = 0; int i = 0; i 0 i < 5 i 5 i++ i++ i {
            if (i != index) {
                sum += round[i];
            }
        } {
            if (i != index) {
                sum += round[i];
            }
        } if (i != index) {
                sum += round[i];
            } i != index i index {
                sum += round[i];
            } sum += round[i] sum round[i] round i if (index >= 0) {
            sum += tempMin;
        } index >= 0 index 0 {
            sum += tempMin;
        } sum += tempMin sum tempMin System.out.println(sum) System.out.println System.out System System.out sum String[] args args public class Main {

    static Scanner sc = new Scanner(System.in);


    public static void main(String[] args) {
        int[] round = new int[5];
        int tempMin = 9;
        int index = -1;
        for (int i = 0; i < 5; i++) {
            int num = sc.nextInt();
            round[i] = (int) (Math.ceil((float) num / 10) * 10);
            if ((num % 10) <= (tempMin % 10) && num % 10 > 0) {
                tempMin = num;
                index = i;
            }
        }
        int sum = 0;
        for (int i = 0; i < 5; i++) {
            if (i != index) {
                sum += round[i];
            }
        }
        if (index >= 0) {
            sum += tempMin;
        }
        System.out.println(sum);
    }
} public class Main {

    static Scanner sc = new Scanner(System.in);


    public static void main(String[] args) {
        int[] round = new int[5];
        int tempMin = 9;
        int index = -1;
        for (int i = 0; i < 5; i++) {
            int num = sc.nextInt();
            round[i] = (int) (Math.ceil((float) num / 10) * 10);
            if ((num % 10) <= (tempMin % 10) && num % 10 > 0) {
                tempMin = num;
                index = i;
            }
        }
        int sum = 0;
        for (int i = 0; i < 5; i++) {
            if (i != index) {
                sum += round[i];
            }
        }
        if (index >= 0) {
            sum += tempMin;
        }
        System.out.println(sum);
    }
} Main


import java.util.Scanner;

public class Main {

    static Scanner sc = new Scanner(System.in);


    public static void main(String[] args) {
        int[] round = new int[5];
        int tempMin = 9;
        int index = -1;
        for (int i = 0; i < 5; i++) {
            int num = sc.nextInt();
            round[i] = (int) (Math.ceil((float) num / 10) * 10);
            if ((num % 10) <= (tempMin % 10) && num % 10 > 0) {
                tempMin = num;
                index = i;
            }
        }
        int sum = 0;
        for (int i = 0; i < 5; i++) {
            if (i != index) {
                sum += round[i];
            }
        }
        if (index >= 0) {
            sum += tempMin;
        }
        System.out.println(sum);
    }
}
