import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.util.*;

public class Main {
    public static void main(String[] args) throws Exception {
        Scanner sc = new Scanner(System.in);
        List<Integer> list = new ArrayList<>();
        Integer last = null;
        int lastIndex = 0;

        for (int i=0; i<5; i++) {
            int input = sc.nextInt();
            if (input % 10 == 0) list.add(input);
            else {
                if (last == null || input % 10 < last % 10) {
                    last = input;
                    lastIndex = i;
                }

                int next10 = input + 10 - (input % 10);
                list.add(next10);
            }
        }

        int sum = 0;
        if (last == null) {
            for (int each: list) {
                sum += each;
            }
        } else {
            for (int i=0; i<5; i++) {
                if (i != lastIndex) {
                    sum += list.get(i);
                }
            }

            sum += last;
        }

        System.out.println(sum);
    }
} import java.io.File; File java.io import java.io.FileInputStream; FileInputStream java.io import java.io.FileNotFoundException; FileNotFoundException java.io import java.util.*; util.* java public class Main {
    public static void main(String[] args) throws Exception {
        Scanner sc = new Scanner(System.in);
        List<Integer> list = new ArrayList<>();
        Integer last = null;
        int lastIndex = 0;

        for (int i=0; i<5; i++) {
            int input = sc.nextInt();
            if (input % 10 == 0) list.add(input);
            else {
                if (last == null || input % 10 < last % 10) {
                    last = input;
                    lastIndex = i;
                }

                int next10 = input + 10 - (input % 10);
                list.add(next10);
            }
        }

        int sum = 0;
        if (last == null) {
            for (int each: list) {
                sum += each;
            }
        } else {
            for (int i=0; i<5; i++) {
                if (i != lastIndex) {
                    sum += list.get(i);
                }
            }

            sum += last;
        }

        System.out.println(sum);
    }
} Main public static void main(String[] args) throws Exception {
        Scanner sc = new Scanner(System.in);
        List<Integer> list = new ArrayList<>();
        Integer last = null;
        int lastIndex = 0;

        for (int i=0; i<5; i++) {
            int input = sc.nextInt();
            if (input % 10 == 0) list.add(input);
            else {
                if (last == null || input % 10 < last % 10) {
                    last = input;
                    lastIndex = i;
                }

                int next10 = input + 10 - (input % 10);
                list.add(next10);
            }
        }

        int sum = 0;
        if (last == null) {
            for (int each: list) {
                sum += each;
            }
        } else {
            for (int i=0; i<5; i++) {
                if (i != lastIndex) {
                    sum += list.get(i);
                }
            }

            sum += last;
        }

        System.out.println(sum);
    } main {
        Scanner sc = new Scanner(System.in);
        List<Integer> list = new ArrayList<>();
        Integer last = null;
        int lastIndex = 0;

        for (int i=0; i<5; i++) {
            int input = sc.nextInt();
            if (input % 10 == 0) list.add(input);
            else {
                if (last == null || input % 10 < last % 10) {
                    last = input;
                    lastIndex = i;
                }

                int next10 = input + 10 - (input % 10);
                list.add(next10);
            }
        }

        int sum = 0;
        if (last == null) {
            for (int each: list) {
                sum += each;
            }
        } else {
            for (int i=0; i<5; i++) {
                if (i != lastIndex) {
                    sum += list.get(i);
                }
            }

            sum += last;
        }

        System.out.println(sum);
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) List<Integer> list = new ArrayList<>(); list new ArrayList<>() Integer last = null; last null int lastIndex = 0; lastIndex 0 for (int i=0; i<5; i++) {
            int input = sc.nextInt();
            if (input % 10 == 0) list.add(input);
            else {
                if (last == null || input % 10 < last % 10) {
                    last = input;
                    lastIndex = i;
                }

                int next10 = input + 10 - (input % 10);
                list.add(next10);
            }
        } int i=0; int i=0; i 0 i<5 i 5 i++ i++ i {
            int input = sc.nextInt();
            if (input % 10 == 0) list.add(input);
            else {
                if (last == null || input % 10 < last % 10) {
                    last = input;
                    lastIndex = i;
                }

                int next10 = input + 10 - (input % 10);
                list.add(next10);
            }
        } {
            int input = sc.nextInt();
            if (input % 10 == 0) list.add(input);
            else {
                if (last == null || input % 10 < last % 10) {
                    last = input;
                    lastIndex = i;
                }

                int next10 = input + 10 - (input % 10);
                list.add(next10);
            }
        } int input = sc.nextInt(); input sc.nextInt() sc.nextInt sc if (input % 10 == 0) list.add(input);
            else {
                if (last == null || input % 10 < last % 10) {
                    last = input;
                    lastIndex = i;
                }

                int next10 = input + 10 - (input % 10);
                list.add(next10);
            } input % 10 == 0 input % 10 input 10 0 list.add(input) list.add list input {
                if (last == null || input % 10 < last % 10) {
                    last = input;
                    lastIndex = i;
                }

                int next10 = input + 10 - (input % 10);
                list.add(next10);
            } if (last == null || input % 10 < last % 10) {
                    last = input;
                    lastIndex = i;
                } last == null || input % 10 < last % 10 last == null last null input % 10 < last % 10 input % 10 input 10 last % 10 last 10 {
                    last = input;
                    lastIndex = i;
                } last = input last input lastIndex = i lastIndex i int next10 = input + 10 - (input % 10); next10 input + 10 - (input % 10) input + 10 input 10 (input % 10) input 10 list.add(next10) list.add list next10 int sum = 0; sum 0 if (last == null) {
            for (int each: list) {
                sum += each;
            }
        } else {
            for (int i=0; i<5; i++) {
                if (i != lastIndex) {
                    sum += list.get(i);
                }
            }

            sum += last;
        } last == null last null {
            for (int each: list) {
                sum += each;
            }
        } for (int each: list) {
                sum += each;
            } int each list {
                sum += each;
            } {
                sum += each;
            } sum += each sum each {
            for (int i=0; i<5; i++) {
                if (i != lastIndex) {
                    sum += list.get(i);
                }
            }

            sum += last;
        } for (int i=0; i<5; i++) {
                if (i != lastIndex) {
                    sum += list.get(i);
                }
            } int i=0; int i=0; i 0 i<5 i 5 i++ i++ i {
                if (i != lastIndex) {
                    sum += list.get(i);
                }
            } {
                if (i != lastIndex) {
                    sum += list.get(i);
                }
            } if (i != lastIndex) {
                    sum += list.get(i);
                } i != lastIndex i lastIndex {
                    sum += list.get(i);
                } sum += list.get(i) sum list.get(i) list.get list i sum += last sum last System.out.println(sum) System.out.println System.out System System.out sum String[] args args public class Main {
    public static void main(String[] args) throws Exception {
        Scanner sc = new Scanner(System.in);
        List<Integer> list = new ArrayList<>();
        Integer last = null;
        int lastIndex = 0;

        for (int i=0; i<5; i++) {
            int input = sc.nextInt();
            if (input % 10 == 0) list.add(input);
            else {
                if (last == null || input % 10 < last % 10) {
                    last = input;
                    lastIndex = i;
                }

                int next10 = input + 10 - (input % 10);
                list.add(next10);
            }
        }

        int sum = 0;
        if (last == null) {
            for (int each: list) {
                sum += each;
            }
        } else {
            for (int i=0; i<5; i++) {
                if (i != lastIndex) {
                    sum += list.get(i);
                }
            }

            sum += last;
        }

        System.out.println(sum);
    }
} public class Main {
    public static void main(String[] args) throws Exception {
        Scanner sc = new Scanner(System.in);
        List<Integer> list = new ArrayList<>();
        Integer last = null;
        int lastIndex = 0;

        for (int i=0; i<5; i++) {
            int input = sc.nextInt();
            if (input % 10 == 0) list.add(input);
            else {
                if (last == null || input % 10 < last % 10) {
                    last = input;
                    lastIndex = i;
                }

                int next10 = input + 10 - (input % 10);
                list.add(next10);
            }
        }

        int sum = 0;
        if (last == null) {
            for (int each: list) {
                sum += each;
            }
        } else {
            for (int i=0; i<5; i++) {
                if (i != lastIndex) {
                    sum += list.get(i);
                }
            }

            sum += last;
        }

        System.out.println(sum);
    }
} Main
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.util.*;

public class Main {
    public static void main(String[] args) throws Exception {
        Scanner sc = new Scanner(System.in);
        List<Integer> list = new ArrayList<>();
        Integer last = null;
        int lastIndex = 0;

        for (int i=0; i<5; i++) {
            int input = sc.nextInt();
            if (input % 10 == 0) list.add(input);
            else {
                if (last == null || input % 10 < last % 10) {
                    last = input;
                    lastIndex = i;
                }

                int next10 = input + 10 - (input % 10);
                list.add(next10);
            }
        }

        int sum = 0;
        if (last == null) {
            for (int each: list) {
                sum += each;
            }
        } else {
            for (int i=0; i<5; i++) {
                if (i != lastIndex) {
                    sum += list.get(i);
                }
            }

            sum += last;
        }

        System.out.println(sum);
    }
}
