import java.util.*;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int[] arr = {sc.nextInt(), sc.nextInt(), sc.nextInt(), sc.nextInt(), sc.nextInt()};

        int sum = 0;
        int slot = arr[0];

        for (int i = 1; i < arr.length; i++) {
            int rem = arr[i] % 10;
            if (rem != 0) {
                if (rem < slot % 10) {
                    sum += (int) Math.ceil(slot / 10.0) * 10;
                    slot = arr[i];
                } else sum += (int) Math.ceil(arr[i] / 10.0) * 10;;
            } else {
                sum += arr[i];
            }
        }
        System.out.println(sum + slot);
    }
} import java.util.*; util.* java public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int[] arr = {sc.nextInt(), sc.nextInt(), sc.nextInt(), sc.nextInt(), sc.nextInt()};

        int sum = 0;
        int slot = arr[0];

        for (int i = 1; i < arr.length; i++) {
            int rem = arr[i] % 10;
            if (rem != 0) {
                if (rem < slot % 10) {
                    sum += (int) Math.ceil(slot / 10.0) * 10;
                    slot = arr[i];
                } else sum += (int) Math.ceil(arr[i] / 10.0) * 10;;
            } else {
                sum += arr[i];
            }
        }
        System.out.println(sum + slot);
    }
} Main public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int[] arr = {sc.nextInt(), sc.nextInt(), sc.nextInt(), sc.nextInt(), sc.nextInt()};

        int sum = 0;
        int slot = arr[0];

        for (int i = 1; i < arr.length; i++) {
            int rem = arr[i] % 10;
            if (rem != 0) {
                if (rem < slot % 10) {
                    sum += (int) Math.ceil(slot / 10.0) * 10;
                    slot = arr[i];
                } else sum += (int) Math.ceil(arr[i] / 10.0) * 10;;
            } else {
                sum += arr[i];
            }
        }
        System.out.println(sum + slot);
    } main {
        Scanner sc = new Scanner(System.in);
        int[] arr = {sc.nextInt(), sc.nextInt(), sc.nextInt(), sc.nextInt(), sc.nextInt()};

        int sum = 0;
        int slot = arr[0];

        for (int i = 1; i < arr.length; i++) {
            int rem = arr[i] % 10;
            if (rem != 0) {
                if (rem < slot % 10) {
                    sum += (int) Math.ceil(slot / 10.0) * 10;
                    slot = arr[i];
                } else sum += (int) Math.ceil(arr[i] / 10.0) * 10;;
            } else {
                sum += arr[i];
            }
        }
        System.out.println(sum + slot);
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int[] arr = {sc.nextInt(), sc.nextInt(), sc.nextInt(), sc.nextInt(), sc.nextInt()}; arr {sc.nextInt(), sc.nextInt(), sc.nextInt(), sc.nextInt(), sc.nextInt()} sc.nextInt() sc.nextInt sc sc.nextInt() sc.nextInt sc sc.nextInt() sc.nextInt sc sc.nextInt() sc.nextInt sc sc.nextInt() sc.nextInt sc int sum = 0; sum 0 int slot = arr[0]; slot arr[0] arr 0 for (int i = 1; i < arr.length; i++) {
            int rem = arr[i] % 10;
            if (rem != 0) {
                if (rem < slot % 10) {
                    sum += (int) Math.ceil(slot / 10.0) * 10;
                    slot = arr[i];
                } else sum += (int) Math.ceil(arr[i] / 10.0) * 10;;
            } else {
                sum += arr[i];
            }
        } int i = 1; int i = 1; i 1 i < arr.length i arr.length arr arr.length i++ i++ i {
            int rem = arr[i] % 10;
            if (rem != 0) {
                if (rem < slot % 10) {
                    sum += (int) Math.ceil(slot / 10.0) * 10;
                    slot = arr[i];
                } else sum += (int) Math.ceil(arr[i] / 10.0) * 10;;
            } else {
                sum += arr[i];
            }
        } {
            int rem = arr[i] % 10;
            if (rem != 0) {
                if (rem < slot % 10) {
                    sum += (int) Math.ceil(slot / 10.0) * 10;
                    slot = arr[i];
                } else sum += (int) Math.ceil(arr[i] / 10.0) * 10;;
            } else {
                sum += arr[i];
            }
        } int rem = arr[i] % 10; rem arr[i] % 10 arr[i] arr i 10 if (rem != 0) {
                if (rem < slot % 10) {
                    sum += (int) Math.ceil(slot / 10.0) * 10;
                    slot = arr[i];
                } else sum += (int) Math.ceil(arr[i] / 10.0) * 10;;
            } else {
                sum += arr[i];
            } rem != 0 rem 0 {
                if (rem < slot % 10) {
                    sum += (int) Math.ceil(slot / 10.0) * 10;
                    slot = arr[i];
                } else sum += (int) Math.ceil(arr[i] / 10.0) * 10;;
            } if (rem < slot % 10) {
                    sum += (int) Math.ceil(slot / 10.0) * 10;
                    slot = arr[i];
                } else sum += (int) Math.ceil(arr[i] / 10.0) * 10; rem < slot % 10 rem slot % 10 slot 10 {
                    sum += (int) Math.ceil(slot / 10.0) * 10;
                    slot = arr[i];
                } sum += (int) Math.ceil(slot / 10.0) * 10 sum (int) Math.ceil(slot / 10.0) * 10 (int) Math.ceil(slot / 10.0) Math.ceil Math slot / 10.0 slot 10.0 10 slot = arr[i] slot arr[i] arr i sum += (int) Math.ceil(arr[i] / 10.0) * 10 sum (int) Math.ceil(arr[i] / 10.0) * 10 (int) Math.ceil(arr[i] / 10.0) Math.ceil Math arr[i] / 10.0 arr[i] arr i 10.0 10 {
                sum += arr[i];
            } sum += arr[i] sum arr[i] arr i System.out.println(sum + slot) System.out.println System.out System System.out sum + slot sum slot String[] args args public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int[] arr = {sc.nextInt(), sc.nextInt(), sc.nextInt(), sc.nextInt(), sc.nextInt()};

        int sum = 0;
        int slot = arr[0];

        for (int i = 1; i < arr.length; i++) {
            int rem = arr[i] % 10;
            if (rem != 0) {
                if (rem < slot % 10) {
                    sum += (int) Math.ceil(slot / 10.0) * 10;
                    slot = arr[i];
                } else sum += (int) Math.ceil(arr[i] / 10.0) * 10;;
            } else {
                sum += arr[i];
            }
        }
        System.out.println(sum + slot);
    }
} public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int[] arr = {sc.nextInt(), sc.nextInt(), sc.nextInt(), sc.nextInt(), sc.nextInt()};

        int sum = 0;
        int slot = arr[0];

        for (int i = 1; i < arr.length; i++) {
            int rem = arr[i] % 10;
            if (rem != 0) {
                if (rem < slot % 10) {
                    sum += (int) Math.ceil(slot / 10.0) * 10;
                    slot = arr[i];
                } else sum += (int) Math.ceil(arr[i] / 10.0) * 10;;
            } else {
                sum += arr[i];
            }
        }
        System.out.println(sum + slot);
    }
} Main
import java.util.*;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int[] arr = {sc.nextInt(), sc.nextInt(), sc.nextInt(), sc.nextInt(), sc.nextInt()};

        int sum = 0;
        int slot = arr[0];

        for (int i = 1; i < arr.length; i++) {
            int rem = arr[i] % 10;
            if (rem != 0) {
                if (rem < slot % 10) {
                    sum += (int) Math.ceil(slot / 10.0) * 10;
                    slot = arr[i];
                } else sum += (int) Math.ceil(arr[i] / 10.0) * 10;;
            } else {
                sum += arr[i];
            }
        }
        System.out.println(sum + slot);
    }
}