
import java.util.Scanner;

public class Main {

    public static void main(String[] args) {
        @SuppressWarnings("resource")
        Scanner sc = new Scanner(System.in);
        int[] a = new int[5];
        int[] b = new int[5];
        for (int i = 0 ; i < 5 ; i++) {
            a[i] = sc.nextInt();
            b[i] = a[i] % 10;
        }
        int min = 123345;
        for (int i = 0 ; i < 5 ; i++) {
            int sum = 0;
            for (int j = 0 ; j < 5 ; j++) {
                if (i == j) {
                    sum += a[j];
                } else {
                    int d = (a[j] + 9) / 10;
                    sum += d * 10;
                }
            }
            min = Math.min(min, sum);
        }

        System.out.println(min);
    }

} import java.util.Scanner; Scanner java.util public class Main {

    public static void main(String[] args) {
        @SuppressWarnings("resource")
        Scanner sc = new Scanner(System.in);
        int[] a = new int[5];
        int[] b = new int[5];
        for (int i = 0 ; i < 5 ; i++) {
            a[i] = sc.nextInt();
            b[i] = a[i] % 10;
        }
        int min = 123345;
        for (int i = 0 ; i < 5 ; i++) {
            int sum = 0;
            for (int j = 0 ; j < 5 ; j++) {
                if (i == j) {
                    sum += a[j];
                } else {
                    int d = (a[j] + 9) / 10;
                    sum += d * 10;
                }
            }
            min = Math.min(min, sum);
        }

        System.out.println(min);
    }

} Main public static void main(String[] args) {
        @SuppressWarnings("resource")
        Scanner sc = new Scanner(System.in);
        int[] a = new int[5];
        int[] b = new int[5];
        for (int i = 0 ; i < 5 ; i++) {
            a[i] = sc.nextInt();
            b[i] = a[i] % 10;
        }
        int min = 123345;
        for (int i = 0 ; i < 5 ; i++) {
            int sum = 0;
            for (int j = 0 ; j < 5 ; j++) {
                if (i == j) {
                    sum += a[j];
                } else {
                    int d = (a[j] + 9) / 10;
                    sum += d * 10;
                }
            }
            min = Math.min(min, sum);
        }

        System.out.println(min);
    } main {
        @SuppressWarnings("resource")
        Scanner sc = new Scanner(System.in);
        int[] a = new int[5];
        int[] b = new int[5];
        for (int i = 0 ; i < 5 ; i++) {
            a[i] = sc.nextInt();
            b[i] = a[i] % 10;
        }
        int min = 123345;
        for (int i = 0 ; i < 5 ; i++) {
            int sum = 0;
            for (int j = 0 ; j < 5 ; j++) {
                if (i == j) {
                    sum += a[j];
                } else {
                    int d = (a[j] + 9) / 10;
                    sum += d * 10;
                }
            }
            min = Math.min(min, sum);
        }

        System.out.println(min);
    } @SuppressWarnings("resource")
        Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int[] a = new int[5]; a new int[5] 5 int[] b = new int[5]; b new int[5] 5 for (int i = 0 ; i < 5 ; i++) {
            a[i] = sc.nextInt();
            b[i] = a[i] % 10;
        } int i = 0 ; int i = 0 ; i 0 i < 5 i 5 i++ i++ i {
            a[i] = sc.nextInt();
            b[i] = a[i] % 10;
        } {
            a[i] = sc.nextInt();
            b[i] = a[i] % 10;
        } a[i] = sc.nextInt() a[i] a i sc.nextInt() sc.nextInt sc b[i] = a[i] % 10 b[i] b i a[i] % 10 a[i] a i 10 int min = 123345; min 123345 for (int i = 0 ; i < 5 ; i++) {
            int sum = 0;
            for (int j = 0 ; j < 5 ; j++) {
                if (i == j) {
                    sum += a[j];
                } else {
                    int d = (a[j] + 9) / 10;
                    sum += d * 10;
                }
            }
            min = Math.min(min, sum);
        } int i = 0 ; int i = 0 ; i 0 i < 5 i 5 i++ i++ i {
            int sum = 0;
            for (int j = 0 ; j < 5 ; j++) {
                if (i == j) {
                    sum += a[j];
                } else {
                    int d = (a[j] + 9) / 10;
                    sum += d * 10;
                }
            }
            min = Math.min(min, sum);
        } {
            int sum = 0;
            for (int j = 0 ; j < 5 ; j++) {
                if (i == j) {
                    sum += a[j];
                } else {
                    int d = (a[j] + 9) / 10;
                    sum += d * 10;
                }
            }
            min = Math.min(min, sum);
        } int sum = 0; sum 0 for (int j = 0 ; j < 5 ; j++) {
                if (i == j) {
                    sum += a[j];
                } else {
                    int d = (a[j] + 9) / 10;
                    sum += d * 10;
                }
            } int j = 0 ; int j = 0 ; j 0 j < 5 j 5 j++ j++ j {
                if (i == j) {
                    sum += a[j];
                } else {
                    int d = (a[j] + 9) / 10;
                    sum += d * 10;
                }
            } {
                if (i == j) {
                    sum += a[j];
                } else {
                    int d = (a[j] + 9) / 10;
                    sum += d * 10;
                }
            } if (i == j) {
                    sum += a[j];
                } else {
                    int d = (a[j] + 9) / 10;
                    sum += d * 10;
                } i == j i j {
                    sum += a[j];
                } sum += a[j] sum a[j] a j {
                    int d = (a[j] + 9) / 10;
                    sum += d * 10;
                } int d = (a[j] + 9) / 10; d (a[j] + 9) / 10 (a[j] + 9) a[j] a j 9 10 sum += d * 10 sum d * 10 d 10 min = Math.min(min, sum) min Math.min(min, sum) Math.min Math min sum System.out.println(min) System.out.println System.out System System.out min String[] args args public class Main {

    public static void main(String[] args) {
        @SuppressWarnings("resource")
        Scanner sc = new Scanner(System.in);
        int[] a = new int[5];
        int[] b = new int[5];
        for (int i = 0 ; i < 5 ; i++) {
            a[i] = sc.nextInt();
            b[i] = a[i] % 10;
        }
        int min = 123345;
        for (int i = 0 ; i < 5 ; i++) {
            int sum = 0;
            for (int j = 0 ; j < 5 ; j++) {
                if (i == j) {
                    sum += a[j];
                } else {
                    int d = (a[j] + 9) / 10;
                    sum += d * 10;
                }
            }
            min = Math.min(min, sum);
        }

        System.out.println(min);
    }

} public class Main {

    public static void main(String[] args) {
        @SuppressWarnings("resource")
        Scanner sc = new Scanner(System.in);
        int[] a = new int[5];
        int[] b = new int[5];
        for (int i = 0 ; i < 5 ; i++) {
            a[i] = sc.nextInt();
            b[i] = a[i] % 10;
        }
        int min = 123345;
        for (int i = 0 ; i < 5 ; i++) {
            int sum = 0;
            for (int j = 0 ; j < 5 ; j++) {
                if (i == j) {
                    sum += a[j];
                } else {
                    int d = (a[j] + 9) / 10;
                    sum += d * 10;
                }
            }
            min = Math.min(min, sum);
        }

        System.out.println(min);
    }

} Main

import java.util.Scanner;

public class Main {

    public static void main(String[] args) {
        @SuppressWarnings("resource")
        Scanner sc = new Scanner(System.in);
        int[] a = new int[5];
        int[] b = new int[5];
        for (int i = 0 ; i < 5 ; i++) {
            a[i] = sc.nextInt();
            b[i] = a[i] % 10;
        }
        int min = 123345;
        for (int i = 0 ; i < 5 ; i++) {
            int sum = 0;
            for (int j = 0 ; j < 5 ; j++) {
                if (i == j) {
                    sum += a[j];
                } else {
                    int d = (a[j] + 9) / 10;
                    sum += d * 10;
                }
            }
            min = Math.min(min, sum);
        }

        System.out.println(min);
    }

}