import java.util.Scanner;

public class Main {
    public static void main(String... args) {
        // 入力
        Scanner sc = new Scanner(System.in);
        int[] x = new int[5];
        x[0] = sc.nextInt();
        x[1] = sc.nextInt();
        x[2] = sc.nextInt();
        x[3] = sc.nextInt();
        x[4] = sc.nextInt();
        int result = 0;

        int min = 9;
        int index = 0;
        for (int i = 0; i < 5; i++) {
            int temp = x[i] % 10;
            if (temp != 0 && temp < min) {
                min = temp;
                index = i;
            }
        }

        for (int i = 0; i < 5; i++) {
            if (i == index) continue;
            if (x[i] % 10 == 0) result += x[i];
            else result += (x[i]/10+1)*10;
        }
        result += x[index];
        System.out.println(result);
    }
} import java.util.Scanner; Scanner java.util public class Main {
    public static void main(String... args) {
        // 入力
        Scanner sc = new Scanner(System.in);
        int[] x = new int[5];
        x[0] = sc.nextInt();
        x[1] = sc.nextInt();
        x[2] = sc.nextInt();
        x[3] = sc.nextInt();
        x[4] = sc.nextInt();
        int result = 0;

        int min = 9;
        int index = 0;
        for (int i = 0; i < 5; i++) {
            int temp = x[i] % 10;
            if (temp != 0 && temp < min) {
                min = temp;
                index = i;
            }
        }

        for (int i = 0; i < 5; i++) {
            if (i == index) continue;
            if (x[i] % 10 == 0) result += x[i];
            else result += (x[i]/10+1)*10;
        }
        result += x[index];
        System.out.println(result);
    }
} Main public static void main(String... args) {
        // 入力
        Scanner sc = new Scanner(System.in);
        int[] x = new int[5];
        x[0] = sc.nextInt();
        x[1] = sc.nextInt();
        x[2] = sc.nextInt();
        x[3] = sc.nextInt();
        x[4] = sc.nextInt();
        int result = 0;

        int min = 9;
        int index = 0;
        for (int i = 0; i < 5; i++) {
            int temp = x[i] % 10;
            if (temp != 0 && temp < min) {
                min = temp;
                index = i;
            }
        }

        for (int i = 0; i < 5; i++) {
            if (i == index) continue;
            if (x[i] % 10 == 0) result += x[i];
            else result += (x[i]/10+1)*10;
        }
        result += x[index];
        System.out.println(result);
    } main {
        // 入力
        Scanner sc = new Scanner(System.in);
        int[] x = new int[5];
        x[0] = sc.nextInt();
        x[1] = sc.nextInt();
        x[2] = sc.nextInt();
        x[3] = sc.nextInt();
        x[4] = sc.nextInt();
        int result = 0;

        int min = 9;
        int index = 0;
        for (int i = 0; i < 5; i++) {
            int temp = x[i] % 10;
            if (temp != 0 && temp < min) {
                min = temp;
                index = i;
            }
        }

        for (int i = 0; i < 5; i++) {
            if (i == index) continue;
            if (x[i] % 10 == 0) result += x[i];
            else result += (x[i]/10+1)*10;
        }
        result += x[index];
        System.out.println(result);
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int[] x = new int[5]; x new int[5] 5 x[0] = sc.nextInt() x[0] x 0 sc.nextInt() sc.nextInt sc x[1] = sc.nextInt() x[1] x 1 sc.nextInt() sc.nextInt sc x[2] = sc.nextInt() x[2] x 2 sc.nextInt() sc.nextInt sc x[3] = sc.nextInt() x[3] x 3 sc.nextInt() sc.nextInt sc x[4] = sc.nextInt() x[4] x 4 sc.nextInt() sc.nextInt sc int result = 0; result 0 int min = 9; min 9 int index = 0; index 0 for (int i = 0; i < 5; i++) {
            int temp = x[i] % 10;
            if (temp != 0 && temp < min) {
                min = temp;
                index = i;
            }
        } int i = 0; int i = 0; i 0 i < 5 i 5 i++ i++ i {
            int temp = x[i] % 10;
            if (temp != 0 && temp < min) {
                min = temp;
                index = i;
            }
        } {
            int temp = x[i] % 10;
            if (temp != 0 && temp < min) {
                min = temp;
                index = i;
            }
        } int temp = x[i] % 10; temp x[i] % 10 x[i] x i 10 if (temp != 0 && temp < min) {
                min = temp;
                index = i;
            } temp != 0 && temp < min temp != 0 temp 0 temp < min temp min {
                min = temp;
                index = i;
            } min = temp min temp index = i index i for (int i = 0; i < 5; i++) {
            if (i == index) continue;
            if (x[i] % 10 == 0) result += x[i];
            else result += (x[i]/10+1)*10;
        } int i = 0; int i = 0; i 0 i < 5 i 5 i++ i++ i {
            if (i == index) continue;
            if (x[i] % 10 == 0) result += x[i];
            else result += (x[i]/10+1)*10;
        } {
            if (i == index) continue;
            if (x[i] % 10 == 0) result += x[i];
            else result += (x[i]/10+1)*10;
        } if (i == index) continue; i == index i index continue; if (x[i] % 10 == 0) result += x[i];
            else result += (x[i]/10+1)*10; x[i] % 10 == 0 x[i] % 10 x[i] x i 10 0 result += x[i] result x[i] x i result += (x[i]/10+1)*10 result (x[i]/10+1)*10 (x[i]/10+1) x[i]/10 x[i] x i 10 1 10 result += x[index] result x[index] x index System.out.println(result) System.out.println System.out System System.out result String... args args public class Main {
    public static void main(String... args) {
        // 入力
        Scanner sc = new Scanner(System.in);
        int[] x = new int[5];
        x[0] = sc.nextInt();
        x[1] = sc.nextInt();
        x[2] = sc.nextInt();
        x[3] = sc.nextInt();
        x[4] = sc.nextInt();
        int result = 0;

        int min = 9;
        int index = 0;
        for (int i = 0; i < 5; i++) {
            int temp = x[i] % 10;
            if (temp != 0 && temp < min) {
                min = temp;
                index = i;
            }
        }

        for (int i = 0; i < 5; i++) {
            if (i == index) continue;
            if (x[i] % 10 == 0) result += x[i];
            else result += (x[i]/10+1)*10;
        }
        result += x[index];
        System.out.println(result);
    }
} public class Main {
    public static void main(String... args) {
        // 入力
        Scanner sc = new Scanner(System.in);
        int[] x = new int[5];
        x[0] = sc.nextInt();
        x[1] = sc.nextInt();
        x[2] = sc.nextInt();
        x[3] = sc.nextInt();
        x[4] = sc.nextInt();
        int result = 0;

        int min = 9;
        int index = 0;
        for (int i = 0; i < 5; i++) {
            int temp = x[i] % 10;
            if (temp != 0 && temp < min) {
                min = temp;
                index = i;
            }
        }

        for (int i = 0; i < 5; i++) {
            if (i == index) continue;
            if (x[i] % 10 == 0) result += x[i];
            else result += (x[i]/10+1)*10;
        }
        result += x[index];
        System.out.println(result);
    }
} Main
import java.util.Scanner;

public class Main {
    public static void main(String... args) {
        // 入力
        Scanner sc = new Scanner(System.in);
        int[] x = new int[5];
        x[0] = sc.nextInt();
        x[1] = sc.nextInt();
        x[2] = sc.nextInt();
        x[3] = sc.nextInt();
        x[4] = sc.nextInt();
        int result = 0;

        int min = 9;
        int index = 0;
        for (int i = 0; i < 5; i++) {
            int temp = x[i] % 10;
            if (temp != 0 && temp < min) {
                min = temp;
                index = i;
            }
        }

        for (int i = 0; i < 5; i++) {
            if (i == index) continue;
            if (x[i] % 10 == 0) result += x[i];
            else result += (x[i]/10+1)*10;
        }
        result += x[index];
        System.out.println(result);
    }
}