import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int result = 0;
        int min = 10;
        for (int i = 0; i < 5; i++) {
            int a = sc.nextInt();
            if (a % 10 != 0 && a % 10 < min) {
                min = a % 10;
            }
            result += Math.ceil((double) a / 10) * 10;
        }
        sc.close();
        if (min != 10) {
            result -= 10 - min;
        }
        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 result = 0;
        int min = 10;
        for (int i = 0; i < 5; i++) {
            int a = sc.nextInt();
            if (a % 10 != 0 && a % 10 < min) {
                min = a % 10;
            }
            result += Math.ceil((double) a / 10) * 10;
        }
        sc.close();
        if (min != 10) {
            result -= 10 - min;
        }
        System.out.println(result);
    }
} Main public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int result = 0;
        int min = 10;
        for (int i = 0; i < 5; i++) {
            int a = sc.nextInt();
            if (a % 10 != 0 && a % 10 < min) {
                min = a % 10;
            }
            result += Math.ceil((double) a / 10) * 10;
        }
        sc.close();
        if (min != 10) {
            result -= 10 - min;
        }
        System.out.println(result);
    } main {
        Scanner sc = new Scanner(System.in);
        int result = 0;
        int min = 10;
        for (int i = 0; i < 5; i++) {
            int a = sc.nextInt();
            if (a % 10 != 0 && a % 10 < min) {
                min = a % 10;
            }
            result += Math.ceil((double) a / 10) * 10;
        }
        sc.close();
        if (min != 10) {
            result -= 10 - min;
        }
        System.out.println(result);
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int result = 0; result 0 int min = 10; min 10 for (int i = 0; i < 5; i++) {
            int a = sc.nextInt();
            if (a % 10 != 0 && a % 10 < min) {
                min = a % 10;
            }
            result += Math.ceil((double) a / 10) * 10;
        } int i = 0; int i = 0; i 0 i < 5 i 5 i++ i++ i {
            int a = sc.nextInt();
            if (a % 10 != 0 && a % 10 < min) {
                min = a % 10;
            }
            result += Math.ceil((double) a / 10) * 10;
        } {
            int a = sc.nextInt();
            if (a % 10 != 0 && a % 10 < min) {
                min = a % 10;
            }
            result += Math.ceil((double) a / 10) * 10;
        } int a = sc.nextInt(); a sc.nextInt() sc.nextInt sc if (a % 10 != 0 && a % 10 < min) {
                min = a % 10;
            } a % 10 != 0 && a % 10 < min a % 10 != 0 a % 10 a 10 0 a % 10 < min a % 10 a 10 min {
                min = a % 10;
            } min = a % 10 min a % 10 a 10 result += Math.ceil((double) a / 10) * 10 result Math.ceil((double) a / 10) * 10 Math.ceil((double) a / 10) Math.ceil Math (double) a / 10 (double) a 10 10 sc.close() sc.close sc if (min != 10) {
            result -= 10 - min;
        } min != 10 min 10 {
            result -= 10 - min;
        } result -= 10 - min result 10 - min 10 min 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 result = 0;
        int min = 10;
        for (int i = 0; i < 5; i++) {
            int a = sc.nextInt();
            if (a % 10 != 0 && a % 10 < min) {
                min = a % 10;
            }
            result += Math.ceil((double) a / 10) * 10;
        }
        sc.close();
        if (min != 10) {
            result -= 10 - min;
        }
        System.out.println(result);
    }
} public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int result = 0;
        int min = 10;
        for (int i = 0; i < 5; i++) {
            int a = sc.nextInt();
            if (a % 10 != 0 && a % 10 < min) {
                min = a % 10;
            }
            result += Math.ceil((double) a / 10) * 10;
        }
        sc.close();
        if (min != 10) {
            result -= 10 - min;
        }
        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 result = 0;
        int min = 10;
        for (int i = 0; i < 5; i++) {
            int a = sc.nextInt();
            if (a % 10 != 0 && a % 10 < min) {
                min = a % 10;
            }
            result += Math.ceil((double) a / 10) * 10;
        }
        sc.close();
        if (min != 10) {
            result -= 10 - min;
        }
        System.out.println(result);
    }
}