import java.util.*;
public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int[] a = new int[5];
        int m = 10;
        int d = 0;
        for (int i = 0; i < a.length; i++) {
            a[i] = sc.nextInt();
            int q = a[i] % 10;
            if (q != 0 && q < m) {
                m = q;
                d = i;
            }
        }
        int sum = 0;
        for (int i = 0; i < a.length; i++) {
            if (i == d) {
                continue;
            }
            if (a[i] % 10 != 0) {
                sum += ((a[i] / 10) + 1) * 10;
            } else {
                sum += a[i];
            }
        }
        sum += a[d];
        System.out.println(sum);
        sc.close();
    }
} import java.util.*; util.* java public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int[] a = new int[5];
        int m = 10;
        int d = 0;
        for (int i = 0; i < a.length; i++) {
            a[i] = sc.nextInt();
            int q = a[i] % 10;
            if (q != 0 && q < m) {
                m = q;
                d = i;
            }
        }
        int sum = 0;
        for (int i = 0; i < a.length; i++) {
            if (i == d) {
                continue;
            }
            if (a[i] % 10 != 0) {
                sum += ((a[i] / 10) + 1) * 10;
            } else {
                sum += a[i];
            }
        }
        sum += a[d];
        System.out.println(sum);
        sc.close();
    }
} Main public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int[] a = new int[5];
        int m = 10;
        int d = 0;
        for (int i = 0; i < a.length; i++) {
            a[i] = sc.nextInt();
            int q = a[i] % 10;
            if (q != 0 && q < m) {
                m = q;
                d = i;
            }
        }
        int sum = 0;
        for (int i = 0; i < a.length; i++) {
            if (i == d) {
                continue;
            }
            if (a[i] % 10 != 0) {
                sum += ((a[i] / 10) + 1) * 10;
            } else {
                sum += a[i];
            }
        }
        sum += a[d];
        System.out.println(sum);
        sc.close();
    } main {
        Scanner sc = new Scanner(System.in);
        int[] a = new int[5];
        int m = 10;
        int d = 0;
        for (int i = 0; i < a.length; i++) {
            a[i] = sc.nextInt();
            int q = a[i] % 10;
            if (q != 0 && q < m) {
                m = q;
                d = i;
            }
        }
        int sum = 0;
        for (int i = 0; i < a.length; i++) {
            if (i == d) {
                continue;
            }
            if (a[i] % 10 != 0) {
                sum += ((a[i] / 10) + 1) * 10;
            } else {
                sum += a[i];
            }
        }
        sum += a[d];
        System.out.println(sum);
        sc.close();
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int[] a = new int[5]; a new int[5] 5 int m = 10; m 10 int d = 0; d 0 for (int i = 0; i < a.length; i++) {
            a[i] = sc.nextInt();
            int q = a[i] % 10;
            if (q != 0 && q < m) {
                m = q;
                d = i;
            }
        } int i = 0; int i = 0; i 0 i < a.length i a.length a a.length i++ i++ i {
            a[i] = sc.nextInt();
            int q = a[i] % 10;
            if (q != 0 && q < m) {
                m = q;
                d = i;
            }
        } {
            a[i] = sc.nextInt();
            int q = a[i] % 10;
            if (q != 0 && q < m) {
                m = q;
                d = i;
            }
        } a[i] = sc.nextInt() a[i] a i sc.nextInt() sc.nextInt sc int q = a[i] % 10; q a[i] % 10 a[i] a i 10 if (q != 0 && q < m) {
                m = q;
                d = i;
            } q != 0 && q < m q != 0 q 0 q < m q m {
                m = q;
                d = i;
            } m = q m q d = i d i int sum = 0; sum 0 for (int i = 0; i < a.length; i++) {
            if (i == d) {
                continue;
            }
            if (a[i] % 10 != 0) {
                sum += ((a[i] / 10) + 1) * 10;
            } else {
                sum += a[i];
            }
        } int i = 0; int i = 0; i 0 i < a.length i a.length a a.length i++ i++ i {
            if (i == d) {
                continue;
            }
            if (a[i] % 10 != 0) {
                sum += ((a[i] / 10) + 1) * 10;
            } else {
                sum += a[i];
            }
        } {
            if (i == d) {
                continue;
            }
            if (a[i] % 10 != 0) {
                sum += ((a[i] / 10) + 1) * 10;
            } else {
                sum += a[i];
            }
        } if (i == d) {
                continue;
            } i == d i d {
                continue;
            } continue; if (a[i] % 10 != 0) {
                sum += ((a[i] / 10) + 1) * 10;
            } else {
                sum += a[i];
            } a[i] % 10 != 0 a[i] % 10 a[i] a i 10 0 {
                sum += ((a[i] / 10) + 1) * 10;
            } sum += ((a[i] / 10) + 1) * 10 sum ((a[i] / 10) + 1) * 10 ((a[i] / 10) + 1) (a[i] / 10) a[i] a i 10 1 10 {
                sum += a[i];
            } sum += a[i] sum a[i] a i sum += a[d] sum a[d] a d System.out.println(sum) System.out.println System.out System System.out sum sc.close() sc.close sc String[] args args public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int[] a = new int[5];
        int m = 10;
        int d = 0;
        for (int i = 0; i < a.length; i++) {
            a[i] = sc.nextInt();
            int q = a[i] % 10;
            if (q != 0 && q < m) {
                m = q;
                d = i;
            }
        }
        int sum = 0;
        for (int i = 0; i < a.length; i++) {
            if (i == d) {
                continue;
            }
            if (a[i] % 10 != 0) {
                sum += ((a[i] / 10) + 1) * 10;
            } else {
                sum += a[i];
            }
        }
        sum += a[d];
        System.out.println(sum);
        sc.close();
    }
} public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int[] a = new int[5];
        int m = 10;
        int d = 0;
        for (int i = 0; i < a.length; i++) {
            a[i] = sc.nextInt();
            int q = a[i] % 10;
            if (q != 0 && q < m) {
                m = q;
                d = i;
            }
        }
        int sum = 0;
        for (int i = 0; i < a.length; i++) {
            if (i == d) {
                continue;
            }
            if (a[i] % 10 != 0) {
                sum += ((a[i] / 10) + 1) * 10;
            } else {
                sum += a[i];
            }
        }
        sum += a[d];
        System.out.println(sum);
        sc.close();
    }
} Main
import java.util.*;
public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int[] a = new int[5];
        int m = 10;
        int d = 0;
        for (int i = 0; i < a.length; i++) {
            a[i] = sc.nextInt();
            int q = a[i] % 10;
            if (q != 0 && q < m) {
                m = q;
                d = i;
            }
        }
        int sum = 0;
        for (int i = 0; i < a.length; i++) {
            if (i == d) {
                continue;
            }
            if (a[i] % 10 != 0) {
                sum += ((a[i] / 10) + 1) * 10;
            } else {
                sum += a[i];
            }
        }
        sum += a[d];
        System.out.println(sum);
        sc.close();
    }
}