import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        final int N = 5;
        Scanner sc = new Scanner(System.in);
        int[] times = new int[N];
        for (int i = 0; i < N; i++) {
            times[i] = sc.nextInt();
        }

        int minIndex = 0;
        int min = times[0]%10;
        for (int i = 1; i < N; i++) {
            if ((times[i]%10 != 0) && (times[i]%10 < min)) {
                minIndex = i;
            }
        }

        int ans = 0;
        for (int i = 0; i < N; i++) {
            if (i == minIndex) {
                ans += times[i];
            }
            else if (times[i]%10 == 0) {
                ans += times[i];
            }
            else {
                ans += (times[i] + (10 - times[i]%10));
            }
        }
        System.out.println(ans);
    }
} import java.util.Scanner; Scanner java.util public class Main {
    public static void main(String[] args) {
        final int N = 5;
        Scanner sc = new Scanner(System.in);
        int[] times = new int[N];
        for (int i = 0; i < N; i++) {
            times[i] = sc.nextInt();
        }

        int minIndex = 0;
        int min = times[0]%10;
        for (int i = 1; i < N; i++) {
            if ((times[i]%10 != 0) && (times[i]%10 < min)) {
                minIndex = i;
            }
        }

        int ans = 0;
        for (int i = 0; i < N; i++) {
            if (i == minIndex) {
                ans += times[i];
            }
            else if (times[i]%10 == 0) {
                ans += times[i];
            }
            else {
                ans += (times[i] + (10 - times[i]%10));
            }
        }
        System.out.println(ans);
    }
} Main public static void main(String[] args) {
        final int N = 5;
        Scanner sc = new Scanner(System.in);
        int[] times = new int[N];
        for (int i = 0; i < N; i++) {
            times[i] = sc.nextInt();
        }

        int minIndex = 0;
        int min = times[0]%10;
        for (int i = 1; i < N; i++) {
            if ((times[i]%10 != 0) && (times[i]%10 < min)) {
                minIndex = i;
            }
        }

        int ans = 0;
        for (int i = 0; i < N; i++) {
            if (i == minIndex) {
                ans += times[i];
            }
            else if (times[i]%10 == 0) {
                ans += times[i];
            }
            else {
                ans += (times[i] + (10 - times[i]%10));
            }
        }
        System.out.println(ans);
    } main {
        final int N = 5;
        Scanner sc = new Scanner(System.in);
        int[] times = new int[N];
        for (int i = 0; i < N; i++) {
            times[i] = sc.nextInt();
        }

        int minIndex = 0;
        int min = times[0]%10;
        for (int i = 1; i < N; i++) {
            if ((times[i]%10 != 0) && (times[i]%10 < min)) {
                minIndex = i;
            }
        }

        int ans = 0;
        for (int i = 0; i < N; i++) {
            if (i == minIndex) {
                ans += times[i];
            }
            else if (times[i]%10 == 0) {
                ans += times[i];
            }
            else {
                ans += (times[i] + (10 - times[i]%10));
            }
        }
        System.out.println(ans);
    } final int N = 5; N 5 Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int[] times = new int[N]; times new int[N] N for (int i = 0; i < N; i++) {
            times[i] = sc.nextInt();
        } int i = 0; int i = 0; i 0 i < N i N i++ i++ i {
            times[i] = sc.nextInt();
        } {
            times[i] = sc.nextInt();
        } times[i] = sc.nextInt() times[i] times i sc.nextInt() sc.nextInt sc int minIndex = 0; minIndex 0 int min = times[0]%10; min times[0]%10 times[0] times 0 10 for (int i = 1; i < N; i++) {
            if ((times[i]%10 != 0) && (times[i]%10 < min)) {
                minIndex = i;
            }
        } int i = 1; int i = 1; i 1 i < N i N i++ i++ i {
            if ((times[i]%10 != 0) && (times[i]%10 < min)) {
                minIndex = i;
            }
        } {
            if ((times[i]%10 != 0) && (times[i]%10 < min)) {
                minIndex = i;
            }
        } if ((times[i]%10 != 0) && (times[i]%10 < min)) {
                minIndex = i;
            } (times[i]%10 != 0) && (times[i]%10 < min) (times[i]%10 != 0) times[i]%10 times[i] times i 10 0 (times[i]%10 < min) times[i]%10 times[i] times i 10 min {
                minIndex = i;
            } minIndex = i minIndex i int ans = 0; ans 0 for (int i = 0; i < N; i++) {
            if (i == minIndex) {
                ans += times[i];
            }
            else if (times[i]%10 == 0) {
                ans += times[i];
            }
            else {
                ans += (times[i] + (10 - times[i]%10));
            }
        } int i = 0; int i = 0; i 0 i < N i N i++ i++ i {
            if (i == minIndex) {
                ans += times[i];
            }
            else if (times[i]%10 == 0) {
                ans += times[i];
            }
            else {
                ans += (times[i] + (10 - times[i]%10));
            }
        } {
            if (i == minIndex) {
                ans += times[i];
            }
            else if (times[i]%10 == 0) {
                ans += times[i];
            }
            else {
                ans += (times[i] + (10 - times[i]%10));
            }
        } if (i == minIndex) {
                ans += times[i];
            }
            else if (times[i]%10 == 0) {
                ans += times[i];
            }
            else {
                ans += (times[i] + (10 - times[i]%10));
            } i == minIndex i minIndex {
                ans += times[i];
            } ans += times[i] ans times[i] times i if (times[i]%10 == 0) {
                ans += times[i];
            }
            else {
                ans += (times[i] + (10 - times[i]%10));
            } times[i]%10 == 0 times[i]%10 times[i] times i 10 0 {
                ans += times[i];
            } ans += times[i] ans times[i] times i {
                ans += (times[i] + (10 - times[i]%10));
            } ans += (times[i] + (10 - times[i]%10)) ans (times[i] + (10 - times[i]%10)) times[i] times i (10 - times[i]%10) 10 times[i]%10 times[i] times i 10 System.out.println(ans) System.out.println System.out System System.out ans String[] args args public class Main {
    public static void main(String[] args) {
        final int N = 5;
        Scanner sc = new Scanner(System.in);
        int[] times = new int[N];
        for (int i = 0; i < N; i++) {
            times[i] = sc.nextInt();
        }

        int minIndex = 0;
        int min = times[0]%10;
        for (int i = 1; i < N; i++) {
            if ((times[i]%10 != 0) && (times[i]%10 < min)) {
                minIndex = i;
            }
        }

        int ans = 0;
        for (int i = 0; i < N; i++) {
            if (i == minIndex) {
                ans += times[i];
            }
            else if (times[i]%10 == 0) {
                ans += times[i];
            }
            else {
                ans += (times[i] + (10 - times[i]%10));
            }
        }
        System.out.println(ans);
    }
} public class Main {
    public static void main(String[] args) {
        final int N = 5;
        Scanner sc = new Scanner(System.in);
        int[] times = new int[N];
        for (int i = 0; i < N; i++) {
            times[i] = sc.nextInt();
        }

        int minIndex = 0;
        int min = times[0]%10;
        for (int i = 1; i < N; i++) {
            if ((times[i]%10 != 0) && (times[i]%10 < min)) {
                minIndex = i;
            }
        }

        int ans = 0;
        for (int i = 0; i < N; i++) {
            if (i == minIndex) {
                ans += times[i];
            }
            else if (times[i]%10 == 0) {
                ans += times[i];
            }
            else {
                ans += (times[i] + (10 - times[i]%10));
            }
        }
        System.out.println(ans);
    }
} Main
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        final int N = 5;
        Scanner sc = new Scanner(System.in);
        int[] times = new int[N];
        for (int i = 0; i < N; i++) {
            times[i] = sc.nextInt();
        }

        int minIndex = 0;
        int min = times[0]%10;
        for (int i = 1; i < N; i++) {
            if ((times[i]%10 != 0) && (times[i]%10 < min)) {
                minIndex = i;
            }
        }

        int ans = 0;
        for (int i = 0; i < N; i++) {
            if (i == minIndex) {
                ans += times[i];
            }
            else if (times[i]%10 == 0) {
                ans += times[i];
            }
            else {
                ans += (times[i] + (10 - times[i]%10));
            }
        }
        System.out.println(ans);
    }
}
