import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.Scanner;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 *
 * @author teiwa
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        Scanner in = new Scanner(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        TaskB solver = new TaskB();
        solver.solve(1, in, out);
        out.close();
    }

    static class TaskB {
        public void solve(int testNumber, Scanner in, PrintWriter out) {
            // input data
            int[] input = new int[5];
            for (int i = 0; i < 5; i++) {
                input[i] = in.nextInt();
            }
            // extract the number that first place is the least
            int firstPlaceMin = 9;
            int target = input[0];
            for (int i = 0; i < 5; i++) {
                int firstPlace = input[i] % 10;
                if (firstPlace != 0 && firstPlace < firstPlaceMin) {
                    firstPlaceMin = firstPlace;
                    target = input[i];
                }
            }

            // calculate the summation of round up number except the target
            int sum = 0;
            for (int i = 0; i < 5; i++) {
                sum += ((input[i] - 1) / 10) * 10 + 10;
            }
            sum = sum - (((target - 1) / 10) * 10 + 10) + target;

            out.println(sum);
        }

    }
}
 import java.io.OutputStream; OutputStream java.io import java.io.IOException; IOException java.io import java.io.InputStream; InputStream java.io import java.io.PrintWriter; PrintWriter java.io import java.util.Scanner; Scanner java.util public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        Scanner in = new Scanner(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        TaskB solver = new TaskB();
        solver.solve(1, in, out);
        out.close();
    }

    static class TaskB {
        public void solve(int testNumber, Scanner in, PrintWriter out) {
            // input data
            int[] input = new int[5];
            for (int i = 0; i < 5; i++) {
                input[i] = in.nextInt();
            }
            // extract the number that first place is the least
            int firstPlaceMin = 9;
            int target = input[0];
            for (int i = 0; i < 5; i++) {
                int firstPlace = input[i] % 10;
                if (firstPlace != 0 && firstPlace < firstPlaceMin) {
                    firstPlaceMin = firstPlace;
                    target = input[i];
                }
            }

            // calculate the summation of round up number except the target
            int sum = 0;
            for (int i = 0; i < 5; i++) {
                sum += ((input[i] - 1) / 10) * 10 + 10;
            }
            sum = sum - (((target - 1) / 10) * 10 + 10) + target;

            out.println(sum);
        }

    }
} Main public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        Scanner in = new Scanner(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        TaskB solver = new TaskB();
        solver.solve(1, in, out);
        out.close();
    } main {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        Scanner in = new Scanner(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        TaskB solver = new TaskB();
        solver.solve(1, in, out);
        out.close();
    } InputStream inputStream = System.in; inputStream System.in System System.in OutputStream outputStream = System.out; outputStream System.out System System.out Scanner in = new Scanner(inputStream); in new Scanner(inputStream) PrintWriter out = new PrintWriter(outputStream); out new PrintWriter(outputStream) TaskB solver = new TaskB(); solver new TaskB() solver.solve(1, in, out) solver.solve solver 1 in out out.close() out.close out String[] args args static class TaskB {
        public void solve(int testNumber, Scanner in, PrintWriter out) {
            // input data
            int[] input = new int[5];
            for (int i = 0; i < 5; i++) {
                input[i] = in.nextInt();
            }
            // extract the number that first place is the least
            int firstPlaceMin = 9;
            int target = input[0];
            for (int i = 0; i < 5; i++) {
                int firstPlace = input[i] % 10;
                if (firstPlace != 0 && firstPlace < firstPlaceMin) {
                    firstPlaceMin = firstPlace;
                    target = input[i];
                }
            }

            // calculate the summation of round up number except the target
            int sum = 0;
            for (int i = 0; i < 5; i++) {
                sum += ((input[i] - 1) / 10) * 10 + 10;
            }
            sum = sum - (((target - 1) / 10) * 10 + 10) + target;

            out.println(sum);
        }

    } TaskB public void solve(int testNumber, Scanner in, PrintWriter out) {
            // input data
            int[] input = new int[5];
            for (int i = 0; i < 5; i++) {
                input[i] = in.nextInt();
            }
            // extract the number that first place is the least
            int firstPlaceMin = 9;
            int target = input[0];
            for (int i = 0; i < 5; i++) {
                int firstPlace = input[i] % 10;
                if (firstPlace != 0 && firstPlace < firstPlaceMin) {
                    firstPlaceMin = firstPlace;
                    target = input[i];
                }
            }

            // calculate the summation of round up number except the target
            int sum = 0;
            for (int i = 0; i < 5; i++) {
                sum += ((input[i] - 1) / 10) * 10 + 10;
            }
            sum = sum - (((target - 1) / 10) * 10 + 10) + target;

            out.println(sum);
        } solve {
            // input data
            int[] input = new int[5];
            for (int i = 0; i < 5; i++) {
                input[i] = in.nextInt();
            }
            // extract the number that first place is the least
            int firstPlaceMin = 9;
            int target = input[0];
            for (int i = 0; i < 5; i++) {
                int firstPlace = input[i] % 10;
                if (firstPlace != 0 && firstPlace < firstPlaceMin) {
                    firstPlaceMin = firstPlace;
                    target = input[i];
                }
            }

            // calculate the summation of round up number except the target
            int sum = 0;
            for (int i = 0; i < 5; i++) {
                sum += ((input[i] - 1) / 10) * 10 + 10;
            }
            sum = sum - (((target - 1) / 10) * 10 + 10) + target;

            out.println(sum);
        } int[] input = new int[5]; input new int[5] 5 for (int i = 0; i < 5; i++) {
                input[i] = in.nextInt();
            } int i = 0; int i = 0; i 0 i < 5 i 5 i++ i++ i {
                input[i] = in.nextInt();
            } {
                input[i] = in.nextInt();
            } input[i] = in.nextInt() input[i] input i in.nextInt() in.nextInt in int firstPlaceMin = 9; firstPlaceMin 9 int target = input[0]; target input[0] input 0 for (int i = 0; i < 5; i++) {
                int firstPlace = input[i] % 10;
                if (firstPlace != 0 && firstPlace < firstPlaceMin) {
                    firstPlaceMin = firstPlace;
                    target = input[i];
                }
            } int i = 0; int i = 0; i 0 i < 5 i 5 i++ i++ i {
                int firstPlace = input[i] % 10;
                if (firstPlace != 0 && firstPlace < firstPlaceMin) {
                    firstPlaceMin = firstPlace;
                    target = input[i];
                }
            } {
                int firstPlace = input[i] % 10;
                if (firstPlace != 0 && firstPlace < firstPlaceMin) {
                    firstPlaceMin = firstPlace;
                    target = input[i];
                }
            } int firstPlace = input[i] % 10; firstPlace input[i] % 10 input[i] input i 10 if (firstPlace != 0 && firstPlace < firstPlaceMin) {
                    firstPlaceMin = firstPlace;
                    target = input[i];
                } firstPlace != 0 && firstPlace < firstPlaceMin firstPlace != 0 firstPlace 0 firstPlace < firstPlaceMin firstPlace firstPlaceMin {
                    firstPlaceMin = firstPlace;
                    target = input[i];
                } firstPlaceMin = firstPlace firstPlaceMin firstPlace target = input[i] target input[i] input i int sum = 0; sum 0 for (int i = 0; i < 5; i++) {
                sum += ((input[i] - 1) / 10) * 10 + 10;
            } int i = 0; int i = 0; i 0 i < 5 i 5 i++ i++ i {
                sum += ((input[i] - 1) / 10) * 10 + 10;
            } {
                sum += ((input[i] - 1) / 10) * 10 + 10;
            } sum += ((input[i] - 1) / 10) * 10 + 10 sum ((input[i] - 1) / 10) * 10 + 10 ((input[i] - 1) / 10) * 10 ((input[i] - 1) / 10) (input[i] - 1) input[i] input i 1 10 10 10 sum = sum - (((target - 1) / 10) * 10 + 10) + target sum sum - (((target - 1) / 10) * 10 + 10) + target sum - (((target - 1) / 10) * 10 + 10) sum (((target - 1) / 10) * 10 + 10) ((target - 1) / 10) * 10 ((target - 1) / 10) (target - 1) target 1 10 10 10 target out.println(sum) out.println out sum int testNumber testNumber Scanner in in PrintWriter out out public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        Scanner in = new Scanner(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        TaskB solver = new TaskB();
        solver.solve(1, in, out);
        out.close();
    }

    static class TaskB {
        public void solve(int testNumber, Scanner in, PrintWriter out) {
            // input data
            int[] input = new int[5];
            for (int i = 0; i < 5; i++) {
                input[i] = in.nextInt();
            }
            // extract the number that first place is the least
            int firstPlaceMin = 9;
            int target = input[0];
            for (int i = 0; i < 5; i++) {
                int firstPlace = input[i] % 10;
                if (firstPlace != 0 && firstPlace < firstPlaceMin) {
                    firstPlaceMin = firstPlace;
                    target = input[i];
                }
            }

            // calculate the summation of round up number except the target
            int sum = 0;
            for (int i = 0; i < 5; i++) {
                sum += ((input[i] - 1) / 10) * 10 + 10;
            }
            sum = sum - (((target - 1) / 10) * 10 + 10) + target;

            out.println(sum);
        }

    }
} public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        Scanner in = new Scanner(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        TaskB solver = new TaskB();
        solver.solve(1, in, out);
        out.close();
    }

    static class TaskB {
        public void solve(int testNumber, Scanner in, PrintWriter out) {
            // input data
            int[] input = new int[5];
            for (int i = 0; i < 5; i++) {
                input[i] = in.nextInt();
            }
            // extract the number that first place is the least
            int firstPlaceMin = 9;
            int target = input[0];
            for (int i = 0; i < 5; i++) {
                int firstPlace = input[i] % 10;
                if (firstPlace != 0 && firstPlace < firstPlaceMin) {
                    firstPlaceMin = firstPlace;
                    target = input[i];
                }
            }

            // calculate the summation of round up number except the target
            int sum = 0;
            for (int i = 0; i < 5; i++) {
                sum += ((input[i] - 1) / 10) * 10 + 10;
            }
            sum = sum - (((target - 1) / 10) * 10 + 10) + target;

            out.println(sum);
        }

    }
} Main
import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.Scanner;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 *
 * @author teiwa
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        Scanner in = new Scanner(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        TaskB solver = new TaskB();
        solver.solve(1, in, out);
        out.close();
    }

    static class TaskB {
        public void solve(int testNumber, Scanner in, PrintWriter out) {
            // input data
            int[] input = new int[5];
            for (int i = 0; i < 5; i++) {
                input[i] = in.nextInt();
            }
            // extract the number that first place is the least
            int firstPlaceMin = 9;
            int target = input[0];
            for (int i = 0; i < 5; i++) {
                int firstPlace = input[i] % 10;
                if (firstPlace != 0 && firstPlace < firstPlaceMin) {
                    firstPlaceMin = firstPlace;
                    target = input[i];
                }
            }

            // calculate the summation of round up number except the target
            int sum = 0;
            for (int i = 0; i < 5; i++) {
                sum += ((input[i] - 1) / 10) * 10 + 10;
            }
            sum = sum - (((target - 1) / 10) * 10 + 10) + target;

            out.println(sum);
        }

    }
}

