import java.util.Scanner;

public class Main {

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

    public static void main(String[] args) {
        int a = sc.nextInt();
        int b = sc.nextInt();
        int c = sc.nextInt();
        int d = sc.nextInt();
        int e = sc.nextInt();
        int[] f = {a,b,c,d,e};
        int time = 0;
        int max = 0;
        for (int n: f) {
            if (n%10 == 0) {
                time += n;
            } else {
                time += n + (10-n%10);
                if (max < (10-n%10)) {
                    max = 10-n%10;
                }
            }
        }
        System.out.println(time-max);
    }
} import java.util.Scanner; Scanner java.util public class Main {

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

    public static void main(String[] args) {
        int a = sc.nextInt();
        int b = sc.nextInt();
        int c = sc.nextInt();
        int d = sc.nextInt();
        int e = sc.nextInt();
        int[] f = {a,b,c,d,e};
        int time = 0;
        int max = 0;
        for (int n: f) {
            if (n%10 == 0) {
                time += n;
            } else {
                time += n + (10-n%10);
                if (max < (10-n%10)) {
                    max = 10-n%10;
                }
            }
        }
        System.out.println(time-max);
    }
} Main static Scanner sc = new Scanner(System.in); sc new Scanner(System.in) public static void main(String[] args) {
        int a = sc.nextInt();
        int b = sc.nextInt();
        int c = sc.nextInt();
        int d = sc.nextInt();
        int e = sc.nextInt();
        int[] f = {a,b,c,d,e};
        int time = 0;
        int max = 0;
        for (int n: f) {
            if (n%10 == 0) {
                time += n;
            } else {
                time += n + (10-n%10);
                if (max < (10-n%10)) {
                    max = 10-n%10;
                }
            }
        }
        System.out.println(time-max);
    } main {
        int a = sc.nextInt();
        int b = sc.nextInt();
        int c = sc.nextInt();
        int d = sc.nextInt();
        int e = sc.nextInt();
        int[] f = {a,b,c,d,e};
        int time = 0;
        int max = 0;
        for (int n: f) {
            if (n%10 == 0) {
                time += n;
            } else {
                time += n + (10-n%10);
                if (max < (10-n%10)) {
                    max = 10-n%10;
                }
            }
        }
        System.out.println(time-max);
    } int a = sc.nextInt(); a sc.nextInt() sc.nextInt sc int b = sc.nextInt(); b sc.nextInt() sc.nextInt sc int c = sc.nextInt(); c sc.nextInt() sc.nextInt sc int d = sc.nextInt(); d sc.nextInt() sc.nextInt sc int e = sc.nextInt(); e sc.nextInt() sc.nextInt sc int[] f = {a,b,c,d,e}; f {a,b,c,d,e} a b c d e int time = 0; time 0 int max = 0; max 0 for (int n: f) {
            if (n%10 == 0) {
                time += n;
            } else {
                time += n + (10-n%10);
                if (max < (10-n%10)) {
                    max = 10-n%10;
                }
            }
        } int n f {
            if (n%10 == 0) {
                time += n;
            } else {
                time += n + (10-n%10);
                if (max < (10-n%10)) {
                    max = 10-n%10;
                }
            }
        } {
            if (n%10 == 0) {
                time += n;
            } else {
                time += n + (10-n%10);
                if (max < (10-n%10)) {
                    max = 10-n%10;
                }
            }
        } if (n%10 == 0) {
                time += n;
            } else {
                time += n + (10-n%10);
                if (max < (10-n%10)) {
                    max = 10-n%10;
                }
            } n%10 == 0 n%10 n 10 0 {
                time += n;
            } time += n time n {
                time += n + (10-n%10);
                if (max < (10-n%10)) {
                    max = 10-n%10;
                }
            } time += n + (10-n%10) time n + (10-n%10) n (10-n%10) 10 n%10 n 10 if (max < (10-n%10)) {
                    max = 10-n%10;
                } max < (10-n%10) max (10-n%10) 10 n%10 n 10 {
                    max = 10-n%10;
                } max = 10-n%10 max 10-n%10 10 n%10 n 10 System.out.println(time-max) System.out.println System.out System System.out time-max time max String[] args args public class Main {

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

    public static void main(String[] args) {
        int a = sc.nextInt();
        int b = sc.nextInt();
        int c = sc.nextInt();
        int d = sc.nextInt();
        int e = sc.nextInt();
        int[] f = {a,b,c,d,e};
        int time = 0;
        int max = 0;
        for (int n: f) {
            if (n%10 == 0) {
                time += n;
            } else {
                time += n + (10-n%10);
                if (max < (10-n%10)) {
                    max = 10-n%10;
                }
            }
        }
        System.out.println(time-max);
    }
} public class Main {

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

    public static void main(String[] args) {
        int a = sc.nextInt();
        int b = sc.nextInt();
        int c = sc.nextInt();
        int d = sc.nextInt();
        int e = sc.nextInt();
        int[] f = {a,b,c,d,e};
        int time = 0;
        int max = 0;
        for (int n: f) {
            if (n%10 == 0) {
                time += n;
            } else {
                time += n + (10-n%10);
                if (max < (10-n%10)) {
                    max = 10-n%10;
                }
            }
        }
        System.out.println(time-max);
    }
} Main
import java.util.Scanner;

public class Main {

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

    public static void main(String[] args) {
        int a = sc.nextInt();
        int b = sc.nextInt();
        int c = sc.nextInt();
        int d = sc.nextInt();
        int e = sc.nextInt();
        int[] f = {a,b,c,d,e};
        int time = 0;
        int max = 0;
        for (int n: f) {
            if (n%10 == 0) {
                time += n;
            } else {
                time += n + (10-n%10);
                if (max < (10-n%10)) {
                    max = 10-n%10;
                }
            }
        }
        System.out.println(time-max);
    }
}
