import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        try (InputReader in = new InputReader(); PrintWriter out = new PrintWriter(System.out)) {
            new Main().solve(in, out);
        }
    }

    private void solve(InputReader in, PrintWriter out) {
        ArrayList<Integer> list = new ArrayList<>();
        list.add(in.nextInt());
        list.add(in.nextInt());
        list.add(in.nextInt());
        list.add(in.nextInt());
        list.add(in.nextInt());

        ArrayList<Integer> nextTImeList = new ArrayList<>();
        for (Integer i : list) {
            nextTImeList.add((i % 10 == 0) ? i : i - (i % 10) + 10);
        }

        int min = Integer.MAX_VALUE;
        for (int i = 0; i < list.size(); i++) {
            int sum = 0;
            for (int j = 0; j < list.size(); j++) {
                sum += (i == j) ? list.get(j) : nextTImeList.get(j);
            }

            min = Math.min(min, sum);
        }

        out.println(min);
    }
}

class InputReader implements AutoCloseable {
    private final Scanner sc = new Scanner(System.in);

    String next() {
        return this.sc.next();
    }

    int nextInt() {
        return Integer.parseInt(this.sc.next());
    }

    long nextLong() {
        return Long.parseLong(this.sc.next());
    }

    double nextDouble() {
        return Double.parseDouble(this.sc.next());
    }

    @Override
    public void close() {
        this.sc.close();
    }
} import java.io.PrintWriter; PrintWriter java.io import java.util.ArrayList; ArrayList java.util import java.util.Scanner; Scanner java.util public class Main {
    public static void main(String[] args) {
        try (InputReader in = new InputReader(); PrintWriter out = new PrintWriter(System.out)) {
            new Main().solve(in, out);
        }
    }

    private void solve(InputReader in, PrintWriter out) {
        ArrayList<Integer> list = new ArrayList<>();
        list.add(in.nextInt());
        list.add(in.nextInt());
        list.add(in.nextInt());
        list.add(in.nextInt());
        list.add(in.nextInt());

        ArrayList<Integer> nextTImeList = new ArrayList<>();
        for (Integer i : list) {
            nextTImeList.add((i % 10 == 0) ? i : i - (i % 10) + 10);
        }

        int min = Integer.MAX_VALUE;
        for (int i = 0; i < list.size(); i++) {
            int sum = 0;
            for (int j = 0; j < list.size(); j++) {
                sum += (i == j) ? list.get(j) : nextTImeList.get(j);
            }

            min = Math.min(min, sum);
        }

        out.println(min);
    }
} Main public static void main(String[] args) {
        try (InputReader in = new InputReader(); PrintWriter out = new PrintWriter(System.out)) {
            new Main().solve(in, out);
        }
    } main {
        try (InputReader in = new InputReader(); PrintWriter out = new PrintWriter(System.out)) {
            new Main().solve(in, out);
        }
    } try (InputReader in = new InputReader(); PrintWriter out = new PrintWriter(System.out)) {
            new Main().solve(in, out);
        } {
            new Main().solve(in, out);
        } InputReader in = new InputReader() InputReader in = new InputReader() new InputReader() PrintWriter out = new PrintWriter(System.out) PrintWriter out = new PrintWriter(System.out) new PrintWriter(System.out) new Main().solve(in, out) new Main().solve new Main() in out String[] args args private void solve(InputReader in, PrintWriter out) {
        ArrayList<Integer> list = new ArrayList<>();
        list.add(in.nextInt());
        list.add(in.nextInt());
        list.add(in.nextInt());
        list.add(in.nextInt());
        list.add(in.nextInt());

        ArrayList<Integer> nextTImeList = new ArrayList<>();
        for (Integer i : list) {
            nextTImeList.add((i % 10 == 0) ? i : i - (i % 10) + 10);
        }

        int min = Integer.MAX_VALUE;
        for (int i = 0; i < list.size(); i++) {
            int sum = 0;
            for (int j = 0; j < list.size(); j++) {
                sum += (i == j) ? list.get(j) : nextTImeList.get(j);
            }

            min = Math.min(min, sum);
        }

        out.println(min);
    } solve {
        ArrayList<Integer> list = new ArrayList<>();
        list.add(in.nextInt());
        list.add(in.nextInt());
        list.add(in.nextInt());
        list.add(in.nextInt());
        list.add(in.nextInt());

        ArrayList<Integer> nextTImeList = new ArrayList<>();
        for (Integer i : list) {
            nextTImeList.add((i % 10 == 0) ? i : i - (i % 10) + 10);
        }

        int min = Integer.MAX_VALUE;
        for (int i = 0; i < list.size(); i++) {
            int sum = 0;
            for (int j = 0; j < list.size(); j++) {
                sum += (i == j) ? list.get(j) : nextTImeList.get(j);
            }

            min = Math.min(min, sum);
        }

        out.println(min);
    } ArrayList<Integer> list = new ArrayList<>(); list new ArrayList<>() list.add(in.nextInt()) list.add list in.nextInt() in.nextInt in list.add(in.nextInt()) list.add list in.nextInt() in.nextInt in list.add(in.nextInt()) list.add list in.nextInt() in.nextInt in list.add(in.nextInt()) list.add list in.nextInt() in.nextInt in list.add(in.nextInt()) list.add list in.nextInt() in.nextInt in ArrayList<Integer> nextTImeList = new ArrayList<>(); nextTImeList new ArrayList<>() for (Integer i : list) {
            nextTImeList.add((i % 10 == 0) ? i : i - (i % 10) + 10);
        } Integer i list {
            nextTImeList.add((i % 10 == 0) ? i : i - (i % 10) + 10);
        } {
            nextTImeList.add((i % 10 == 0) ? i : i - (i % 10) + 10);
        } nextTImeList.add((i % 10 == 0) ? i : i - (i % 10) + 10) nextTImeList.add nextTImeList (i % 10 == 0) ? i : i - (i % 10) + 10 (i % 10 == 0) i % 10 i 10 0 i i - (i % 10) + 10 i - (i % 10) i (i % 10) i 10 10 int min = Integer.MAX_VALUE; min Integer.MAX_VALUE Integer Integer.MAX_VALUE for (int i = 0; i < list.size(); i++) {
            int sum = 0;
            for (int j = 0; j < list.size(); j++) {
                sum += (i == j) ? list.get(j) : nextTImeList.get(j);
            }

            min = Math.min(min, sum);
        } int i = 0; int i = 0; i 0 i < list.size() i list.size() list.size list i++ i++ i {
            int sum = 0;
            for (int j = 0; j < list.size(); j++) {
                sum += (i == j) ? list.get(j) : nextTImeList.get(j);
            }

            min = Math.min(min, sum);
        } {
            int sum = 0;
            for (int j = 0; j < list.size(); j++) {
                sum += (i == j) ? list.get(j) : nextTImeList.get(j);
            }

            min = Math.min(min, sum);
        } int sum = 0; sum 0 for (int j = 0; j < list.size(); j++) {
                sum += (i == j) ? list.get(j) : nextTImeList.get(j);
            } int j = 0; int j = 0; j 0 j < list.size() j list.size() list.size list j++ j++ j {
                sum += (i == j) ? list.get(j) : nextTImeList.get(j);
            } {
                sum += (i == j) ? list.get(j) : nextTImeList.get(j);
            } sum += (i == j) ? list.get(j) : nextTImeList.get(j) sum (i == j) ? list.get(j) : nextTImeList.get(j) (i == j) i j list.get(j) list.get list j nextTImeList.get(j) nextTImeList.get nextTImeList j min = Math.min(min, sum) min Math.min(min, sum) Math.min Math min sum out.println(min) out.println out min InputReader in in PrintWriter out out class InputReader implements AutoCloseable {
    private final Scanner sc = new Scanner(System.in);

    String next() {
        return this.sc.next();
    }

    int nextInt() {
        return Integer.parseInt(this.sc.next());
    }

    long nextLong() {
        return Long.parseLong(this.sc.next());
    }

    double nextDouble() {
        return Double.parseDouble(this.sc.next());
    }

    @Override
    public void close() {
        this.sc.close();
    }
} InputReader private final Scanner sc = new Scanner(System.in); sc new Scanner(System.in) String next() {
        return this.sc.next();
    } next {
        return this.sc.next();
    } return this.sc.next(); this.sc.next() this.sc.next this.sc this this.sc int nextInt() {
        return Integer.parseInt(this.sc.next());
    } nextInt {
        return Integer.parseInt(this.sc.next());
    } return Integer.parseInt(this.sc.next()); Integer.parseInt(this.sc.next()) Integer.parseInt Integer this.sc.next() this.sc.next this.sc this this.sc long nextLong() {
        return Long.parseLong(this.sc.next());
    } nextLong {
        return Long.parseLong(this.sc.next());
    } return Long.parseLong(this.sc.next()); Long.parseLong(this.sc.next()) Long.parseLong Long this.sc.next() this.sc.next this.sc this this.sc double nextDouble() {
        return Double.parseDouble(this.sc.next());
    } nextDouble {
        return Double.parseDouble(this.sc.next());
    } return Double.parseDouble(this.sc.next()); Double.parseDouble(this.sc.next()) Double.parseDouble Double this.sc.next() this.sc.next this.sc this this.sc @Override
    public void close() {
        this.sc.close();
    } close {
        this.sc.close();
    } this.sc.close() this.sc.close this.sc this this.sc AutoCloseable public class Main {
    public static void main(String[] args) {
        try (InputReader in = new InputReader(); PrintWriter out = new PrintWriter(System.out)) {
            new Main().solve(in, out);
        }
    }

    private void solve(InputReader in, PrintWriter out) {
        ArrayList<Integer> list = new ArrayList<>();
        list.add(in.nextInt());
        list.add(in.nextInt());
        list.add(in.nextInt());
        list.add(in.nextInt());
        list.add(in.nextInt());

        ArrayList<Integer> nextTImeList = new ArrayList<>();
        for (Integer i : list) {
            nextTImeList.add((i % 10 == 0) ? i : i - (i % 10) + 10);
        }

        int min = Integer.MAX_VALUE;
        for (int i = 0; i < list.size(); i++) {
            int sum = 0;
            for (int j = 0; j < list.size(); j++) {
                sum += (i == j) ? list.get(j) : nextTImeList.get(j);
            }

            min = Math.min(min, sum);
        }

        out.println(min);
    }
} public class Main {
    public static void main(String[] args) {
        try (InputReader in = new InputReader(); PrintWriter out = new PrintWriter(System.out)) {
            new Main().solve(in, out);
        }
    }

    private void solve(InputReader in, PrintWriter out) {
        ArrayList<Integer> list = new ArrayList<>();
        list.add(in.nextInt());
        list.add(in.nextInt());
        list.add(in.nextInt());
        list.add(in.nextInt());
        list.add(in.nextInt());

        ArrayList<Integer> nextTImeList = new ArrayList<>();
        for (Integer i : list) {
            nextTImeList.add((i % 10 == 0) ? i : i - (i % 10) + 10);
        }

        int min = Integer.MAX_VALUE;
        for (int i = 0; i < list.size(); i++) {
            int sum = 0;
            for (int j = 0; j < list.size(); j++) {
                sum += (i == j) ? list.get(j) : nextTImeList.get(j);
            }

            min = Math.min(min, sum);
        }

        out.println(min);
    }
} Main
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        try (InputReader in = new InputReader(); PrintWriter out = new PrintWriter(System.out)) {
            new Main().solve(in, out);
        }
    }

    private void solve(InputReader in, PrintWriter out) {
        ArrayList<Integer> list = new ArrayList<>();
        list.add(in.nextInt());
        list.add(in.nextInt());
        list.add(in.nextInt());
        list.add(in.nextInt());
        list.add(in.nextInt());

        ArrayList<Integer> nextTImeList = new ArrayList<>();
        for (Integer i : list) {
            nextTImeList.add((i % 10 == 0) ? i : i - (i % 10) + 10);
        }

        int min = Integer.MAX_VALUE;
        for (int i = 0; i < list.size(); i++) {
            int sum = 0;
            for (int j = 0; j < list.size(); j++) {
                sum += (i == j) ? list.get(j) : nextTImeList.get(j);
            }

            min = Math.min(min, sum);
        }

        out.println(min);
    }
}

class InputReader implements AutoCloseable {
    private final Scanner sc = new Scanner(System.in);

    String next() {
        return this.sc.next();
    }

    int nextInt() {
        return Integer.parseInt(this.sc.next());
    }

    long nextLong() {
        return Long.parseLong(this.sc.next());
    }

    double nextDouble() {
        return Double.parseDouble(this.sc.next());
    }

    @Override
    public void close() {
        this.sc.close();
    }
}
