import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = 0;
        int min = 10;
        for (int i = 0; i < 5; i++) {
            float a = sc.nextFloat();
            n += Math.ceil(a / 10) * 10;
            String str = String.valueOf((int)a);
            int b = Integer.parseInt(str.substring(str.length() - 1));
            if (b < min && b >= 1) {
                min = b;
            }
        }
        System.out.println(n + min - 10);
    }
} import java.util.Scanner; Scanner java.util public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = 0;
        int min = 10;
        for (int i = 0; i < 5; i++) {
            float a = sc.nextFloat();
            n += Math.ceil(a / 10) * 10;
            String str = String.valueOf((int)a);
            int b = Integer.parseInt(str.substring(str.length() - 1));
            if (b < min && b >= 1) {
                min = b;
            }
        }
        System.out.println(n + min - 10);
    }
} Main public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = 0;
        int min = 10;
        for (int i = 0; i < 5; i++) {
            float a = sc.nextFloat();
            n += Math.ceil(a / 10) * 10;
            String str = String.valueOf((int)a);
            int b = Integer.parseInt(str.substring(str.length() - 1));
            if (b < min && b >= 1) {
                min = b;
            }
        }
        System.out.println(n + min - 10);
    } main {
        Scanner sc = new Scanner(System.in);
        int n = 0;
        int min = 10;
        for (int i = 0; i < 5; i++) {
            float a = sc.nextFloat();
            n += Math.ceil(a / 10) * 10;
            String str = String.valueOf((int)a);
            int b = Integer.parseInt(str.substring(str.length() - 1));
            if (b < min && b >= 1) {
                min = b;
            }
        }
        System.out.println(n + min - 10);
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int n = 0; n 0 int min = 10; min 10 for (int i = 0; i < 5; i++) {
            float a = sc.nextFloat();
            n += Math.ceil(a / 10) * 10;
            String str = String.valueOf((int)a);
            int b = Integer.parseInt(str.substring(str.length() - 1));
            if (b < min && b >= 1) {
                min = b;
            }
        } int i = 0; int i = 0; i 0 i < 5 i 5 i++ i++ i {
            float a = sc.nextFloat();
            n += Math.ceil(a / 10) * 10;
            String str = String.valueOf((int)a);
            int b = Integer.parseInt(str.substring(str.length() - 1));
            if (b < min && b >= 1) {
                min = b;
            }
        } {
            float a = sc.nextFloat();
            n += Math.ceil(a / 10) * 10;
            String str = String.valueOf((int)a);
            int b = Integer.parseInt(str.substring(str.length() - 1));
            if (b < min && b >= 1) {
                min = b;
            }
        } float a = sc.nextFloat(); a sc.nextFloat() sc.nextFloat sc n += Math.ceil(a / 10) * 10 n Math.ceil(a / 10) * 10 Math.ceil(a / 10) Math.ceil Math a / 10 a 10 10 String str = String.valueOf((int)a); str String.valueOf((int)a) String.valueOf String (int)a int b = Integer.parseInt(str.substring(str.length() - 1)); b Integer.parseInt(str.substring(str.length() - 1)) Integer.parseInt Integer str.substring(str.length() - 1) str.substring str str.length() - 1 str.length() str.length str 1 if (b < min && b >= 1) {
                min = b;
            } b < min && b >= 1 b < min b min b >= 1 b 1 {
                min = b;
            } min = b min b System.out.println(n + min - 10) System.out.println System.out System System.out n + min - 10 n + min n min 10 String[] args args public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = 0;
        int min = 10;
        for (int i = 0; i < 5; i++) {
            float a = sc.nextFloat();
            n += Math.ceil(a / 10) * 10;
            String str = String.valueOf((int)a);
            int b = Integer.parseInt(str.substring(str.length() - 1));
            if (b < min && b >= 1) {
                min = b;
            }
        }
        System.out.println(n + min - 10);
    }
} public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = 0;
        int min = 10;
        for (int i = 0; i < 5; i++) {
            float a = sc.nextFloat();
            n += Math.ceil(a / 10) * 10;
            String str = String.valueOf((int)a);
            int b = Integer.parseInt(str.substring(str.length() - 1));
            if (b < min && b >= 1) {
                min = b;
            }
        }
        System.out.println(n + min - 10);
    }
} Main
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = 0;
        int min = 10;
        for (int i = 0; i < 5; i++) {
            float a = sc.nextFloat();
            n += Math.ceil(a / 10) * 10;
            String str = String.valueOf((int)a);
            int b = Integer.parseInt(str.substring(str.length() - 1));
            if (b < min && b >= 1) {
                min = b;
            }
        }
        System.out.println(n + min - 10);
    }
}