import java.util.Scanner;

public class Main {

    public static void main(String args[]) {

        Scanner sc = new Scanner(System.in);
        Integer[] menu = {Integer.parseInt(sc.next()),
                Integer.parseInt(sc.next()),
                Integer.parseInt(sc.next()),
                Integer.parseInt(sc.next()),
                Integer.parseInt(sc.next())};

        int result = 0;
        int onesPlace = 10;
        for (int time : menu) {
            result += (int) Math.ceil(time / 10.0) * 10;
            if (time % 10 != 0) {
                onesPlace = Math.min(onesPlace, time % 10);
            }
        }

        System.out.println(result + onesPlace - 10);
    }
} import java.util.Scanner; Scanner java.util public class Main {

    public static void main(String args[]) {

        Scanner sc = new Scanner(System.in);
        Integer[] menu = {Integer.parseInt(sc.next()),
                Integer.parseInt(sc.next()),
                Integer.parseInt(sc.next()),
                Integer.parseInt(sc.next()),
                Integer.parseInt(sc.next())};

        int result = 0;
        int onesPlace = 10;
        for (int time : menu) {
            result += (int) Math.ceil(time / 10.0) * 10;
            if (time % 10 != 0) {
                onesPlace = Math.min(onesPlace, time % 10);
            }
        }

        System.out.println(result + onesPlace - 10);
    }
} Main public static void main(String args[]) {

        Scanner sc = new Scanner(System.in);
        Integer[] menu = {Integer.parseInt(sc.next()),
                Integer.parseInt(sc.next()),
                Integer.parseInt(sc.next()),
                Integer.parseInt(sc.next()),
                Integer.parseInt(sc.next())};

        int result = 0;
        int onesPlace = 10;
        for (int time : menu) {
            result += (int) Math.ceil(time / 10.0) * 10;
            if (time % 10 != 0) {
                onesPlace = Math.min(onesPlace, time % 10);
            }
        }

        System.out.println(result + onesPlace - 10);
    } main {

        Scanner sc = new Scanner(System.in);
        Integer[] menu = {Integer.parseInt(sc.next()),
                Integer.parseInt(sc.next()),
                Integer.parseInt(sc.next()),
                Integer.parseInt(sc.next()),
                Integer.parseInt(sc.next())};

        int result = 0;
        int onesPlace = 10;
        for (int time : menu) {
            result += (int) Math.ceil(time / 10.0) * 10;
            if (time % 10 != 0) {
                onesPlace = Math.min(onesPlace, time % 10);
            }
        }

        System.out.println(result + onesPlace - 10);
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) Integer[] menu = {Integer.parseInt(sc.next()),
                Integer.parseInt(sc.next()),
                Integer.parseInt(sc.next()),
                Integer.parseInt(sc.next()),
                Integer.parseInt(sc.next())}; menu {Integer.parseInt(sc.next()),
                Integer.parseInt(sc.next()),
                Integer.parseInt(sc.next()),
                Integer.parseInt(sc.next()),
                Integer.parseInt(sc.next())} Integer.parseInt(sc.next()) Integer.parseInt Integer sc.next() sc.next sc Integer.parseInt(sc.next()) Integer.parseInt Integer sc.next() sc.next sc Integer.parseInt(sc.next()) Integer.parseInt Integer sc.next() sc.next sc Integer.parseInt(sc.next()) Integer.parseInt Integer sc.next() sc.next sc Integer.parseInt(sc.next()) Integer.parseInt Integer sc.next() sc.next sc int result = 0; result 0 int onesPlace = 10; onesPlace 10 for (int time : menu) {
            result += (int) Math.ceil(time / 10.0) * 10;
            if (time % 10 != 0) {
                onesPlace = Math.min(onesPlace, time % 10);
            }
        } int time menu {
            result += (int) Math.ceil(time / 10.0) * 10;
            if (time % 10 != 0) {
                onesPlace = Math.min(onesPlace, time % 10);
            }
        } {
            result += (int) Math.ceil(time / 10.0) * 10;
            if (time % 10 != 0) {
                onesPlace = Math.min(onesPlace, time % 10);
            }
        } result += (int) Math.ceil(time / 10.0) * 10 result (int) Math.ceil(time / 10.0) * 10 (int) Math.ceil(time / 10.0) Math.ceil Math time / 10.0 time 10.0 10 if (time % 10 != 0) {
                onesPlace = Math.min(onesPlace, time % 10);
            } time % 10 != 0 time % 10 time 10 0 {
                onesPlace = Math.min(onesPlace, time % 10);
            } onesPlace = Math.min(onesPlace, time % 10) onesPlace Math.min(onesPlace, time % 10) Math.min Math onesPlace time % 10 time 10 System.out.println(result + onesPlace - 10) System.out.println System.out System System.out result + onesPlace - 10 result + onesPlace result onesPlace 10 String args[] args public class Main {

    public static void main(String args[]) {

        Scanner sc = new Scanner(System.in);
        Integer[] menu = {Integer.parseInt(sc.next()),
                Integer.parseInt(sc.next()),
                Integer.parseInt(sc.next()),
                Integer.parseInt(sc.next()),
                Integer.parseInt(sc.next())};

        int result = 0;
        int onesPlace = 10;
        for (int time : menu) {
            result += (int) Math.ceil(time / 10.0) * 10;
            if (time % 10 != 0) {
                onesPlace = Math.min(onesPlace, time % 10);
            }
        }

        System.out.println(result + onesPlace - 10);
    }
} public class Main {

    public static void main(String args[]) {

        Scanner sc = new Scanner(System.in);
        Integer[] menu = {Integer.parseInt(sc.next()),
                Integer.parseInt(sc.next()),
                Integer.parseInt(sc.next()),
                Integer.parseInt(sc.next()),
                Integer.parseInt(sc.next())};

        int result = 0;
        int onesPlace = 10;
        for (int time : menu) {
            result += (int) Math.ceil(time / 10.0) * 10;
            if (time % 10 != 0) {
                onesPlace = Math.min(onesPlace, time % 10);
            }
        }

        System.out.println(result + onesPlace - 10);
    }
} Main
import java.util.Scanner;

public class Main {

    public static void main(String args[]) {

        Scanner sc = new Scanner(System.in);
        Integer[] menu = {Integer.parseInt(sc.next()),
                Integer.parseInt(sc.next()),
                Integer.parseInt(sc.next()),
                Integer.parseInt(sc.next()),
                Integer.parseInt(sc.next())};

        int result = 0;
        int onesPlace = 10;
        for (int time : menu) {
            result += (int) Math.ceil(time / 10.0) * 10;
            if (time % 10 != 0) {
                onesPlace = Math.min(onesPlace, time % 10);
            }
        }

        System.out.println(result + onesPlace - 10);
    }
}