import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int min = 999;
        int sum = 0;
        for (int i = 0; i < 5; i++) {
            int tmp = sc.nextInt();
            if (tmp % 10 < min && tmp % 10 != 0) {
                min = tmp % 10;
            }

            sum += ((int)Math.ceil(tmp/10.0) * 10);
        }
        if (min != 999) {
            sum = sum - (10 - min);
        }

        System.out.println(sum);
    }
} import java.util.Scanner; Scanner java.util public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int min = 999;
        int sum = 0;
        for (int i = 0; i < 5; i++) {
            int tmp = sc.nextInt();
            if (tmp % 10 < min && tmp % 10 != 0) {
                min = tmp % 10;
            }

            sum += ((int)Math.ceil(tmp/10.0) * 10);
        }
        if (min != 999) {
            sum = sum - (10 - min);
        }

        System.out.println(sum);
    }
} Main public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int min = 999;
        int sum = 0;
        for (int i = 0; i < 5; i++) {
            int tmp = sc.nextInt();
            if (tmp % 10 < min && tmp % 10 != 0) {
                min = tmp % 10;
            }

            sum += ((int)Math.ceil(tmp/10.0) * 10);
        }
        if (min != 999) {
            sum = sum - (10 - min);
        }

        System.out.println(sum);
    } main {
        Scanner sc = new Scanner(System.in);
        int min = 999;
        int sum = 0;
        for (int i = 0; i < 5; i++) {
            int tmp = sc.nextInt();
            if (tmp % 10 < min && tmp % 10 != 0) {
                min = tmp % 10;
            }

            sum += ((int)Math.ceil(tmp/10.0) * 10);
        }
        if (min != 999) {
            sum = sum - (10 - min);
        }

        System.out.println(sum);
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int min = 999; min 999 int sum = 0; sum 0 for (int i = 0; i < 5; i++) {
            int tmp = sc.nextInt();
            if (tmp % 10 < min && tmp % 10 != 0) {
                min = tmp % 10;
            }

            sum += ((int)Math.ceil(tmp/10.0) * 10);
        } int i = 0; int i = 0; i 0 i < 5 i 5 i++ i++ i {
            int tmp = sc.nextInt();
            if (tmp % 10 < min && tmp % 10 != 0) {
                min = tmp % 10;
            }

            sum += ((int)Math.ceil(tmp/10.0) * 10);
        } {
            int tmp = sc.nextInt();
            if (tmp % 10 < min && tmp % 10 != 0) {
                min = tmp % 10;
            }

            sum += ((int)Math.ceil(tmp/10.0) * 10);
        } int tmp = sc.nextInt(); tmp sc.nextInt() sc.nextInt sc if (tmp % 10 < min && tmp % 10 != 0) {
                min = tmp % 10;
            } tmp % 10 < min && tmp % 10 != 0 tmp % 10 < min tmp % 10 tmp 10 min tmp % 10 != 0 tmp % 10 tmp 10 0 {
                min = tmp % 10;
            } min = tmp % 10 min tmp % 10 tmp 10 sum += ((int)Math.ceil(tmp/10.0) * 10) sum ((int)Math.ceil(tmp/10.0) * 10) (int)Math.ceil(tmp/10.0) Math.ceil Math tmp/10.0 tmp 10.0 10 if (min != 999) {
            sum = sum - (10 - min);
        } min != 999 min 999 {
            sum = sum - (10 - min);
        } sum = sum - (10 - min) sum sum - (10 - min) sum (10 - min) 10 min System.out.println(sum) System.out.println System.out System System.out sum String[] args args public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int min = 999;
        int sum = 0;
        for (int i = 0; i < 5; i++) {
            int tmp = sc.nextInt();
            if (tmp % 10 < min && tmp % 10 != 0) {
                min = tmp % 10;
            }

            sum += ((int)Math.ceil(tmp/10.0) * 10);
        }
        if (min != 999) {
            sum = sum - (10 - min);
        }

        System.out.println(sum);
    }
} public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int min = 999;
        int sum = 0;
        for (int i = 0; i < 5; i++) {
            int tmp = sc.nextInt();
            if (tmp % 10 < min && tmp % 10 != 0) {
                min = tmp % 10;
            }

            sum += ((int)Math.ceil(tmp/10.0) * 10);
        }
        if (min != 999) {
            sum = sum - (10 - min);
        }

        System.out.println(sum);
    }
} Main
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int min = 999;
        int sum = 0;
        for (int i = 0; i < 5; i++) {
            int tmp = sc.nextInt();
            if (tmp % 10 < min && tmp % 10 != 0) {
                min = tmp % 10;
            }

            sum += ((int)Math.ceil(tmp/10.0) * 10);
        }
        if (min != 999) {
            sum = sum - (10 - min);
        }

        System.out.println(sum);
    }
}