import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int[] n = new int[5];
        for (int i = 0; i < 5; i++) n[i] = sc.nextInt();
        int ans = 0, last = 10;
        for (int ni: n) {
            ans += Math.ceil(ni/10.0) * 10;
            if (ni % 10 != 0) last = Math.min(last, ni%10);
        }
        if (last != 10) ans -= 10 - last;
        System.out.println(ans);
    }
} import java.util.Scanner; Scanner java.util public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int[] n = new int[5];
        for (int i = 0; i < 5; i++) n[i] = sc.nextInt();
        int ans = 0, last = 10;
        for (int ni: n) {
            ans += Math.ceil(ni/10.0) * 10;
            if (ni % 10 != 0) last = Math.min(last, ni%10);
        }
        if (last != 10) ans -= 10 - last;
        System.out.println(ans);
    }
} Main public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int[] n = new int[5];
        for (int i = 0; i < 5; i++) n[i] = sc.nextInt();
        int ans = 0, last = 10;
        for (int ni: n) {
            ans += Math.ceil(ni/10.0) * 10;
            if (ni % 10 != 0) last = Math.min(last, ni%10);
        }
        if (last != 10) ans -= 10 - last;
        System.out.println(ans);
    } main {
        Scanner sc = new Scanner(System.in);
        int[] n = new int[5];
        for (int i = 0; i < 5; i++) n[i] = sc.nextInt();
        int ans = 0, last = 10;
        for (int ni: n) {
            ans += Math.ceil(ni/10.0) * 10;
            if (ni % 10 != 0) last = Math.min(last, ni%10);
        }
        if (last != 10) ans -= 10 - last;
        System.out.println(ans);
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int[] n = new int[5]; n new int[5] 5 for (int i = 0; i < 5; i++) n[i] = sc.nextInt(); int i = 0; int i = 0; i 0 i < 5 i 5 i++ i++ i n[i] = sc.nextInt(); n[i] = sc.nextInt() n[i] n i sc.nextInt() sc.nextInt sc int ans = 0 ans 0 last = 10; last 10 for (int ni: n) {
            ans += Math.ceil(ni/10.0) * 10;
            if (ni % 10 != 0) last = Math.min(last, ni%10);
        } int ni n {
            ans += Math.ceil(ni/10.0) * 10;
            if (ni % 10 != 0) last = Math.min(last, ni%10);
        } {
            ans += Math.ceil(ni/10.0) * 10;
            if (ni % 10 != 0) last = Math.min(last, ni%10);
        } ans += Math.ceil(ni/10.0) * 10 ans Math.ceil(ni/10.0) * 10 Math.ceil(ni/10.0) Math.ceil Math ni/10.0 ni 10.0 10 if (ni % 10 != 0) last = Math.min(last, ni%10); ni % 10 != 0 ni % 10 ni 10 0 last = Math.min(last, ni%10) last Math.min(last, ni%10) Math.min Math last ni%10 ni 10 if (last != 10) ans -= 10 - last; last != 10 last 10 ans -= 10 - last ans 10 - last 10 last System.out.println(ans) System.out.println System.out System System.out ans String[] args args public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int[] n = new int[5];
        for (int i = 0; i < 5; i++) n[i] = sc.nextInt();
        int ans = 0, last = 10;
        for (int ni: n) {
            ans += Math.ceil(ni/10.0) * 10;
            if (ni % 10 != 0) last = Math.min(last, ni%10);
        }
        if (last != 10) ans -= 10 - last;
        System.out.println(ans);
    }
} public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int[] n = new int[5];
        for (int i = 0; i < 5; i++) n[i] = sc.nextInt();
        int ans = 0, last = 10;
        for (int ni: n) {
            ans += Math.ceil(ni/10.0) * 10;
            if (ni % 10 != 0) last = Math.min(last, ni%10);
        }
        if (last != 10) ans -= 10 - last;
        System.out.println(ans);
    }
} Main
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int[] n = new int[5];
        for (int i = 0; i < 5; i++) n[i] = sc.nextInt();
        int ans = 0, last = 10;
        for (int ni: n) {
            ans += Math.ceil(ni/10.0) * 10;
            if (ni % 10 != 0) last = Math.min(last, ni%10);
        }
        if (last != 10) ans -= 10 - last;
        System.out.println(ans);
    }
}
