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

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 */
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);
        B solver = new B();
        solver.solve(1, in, out);
        out.close();
    }

    static class B {
        public void solve(int testNumber, Scanner in, PrintWriter out) {
            // 入力
            int c[] = new int[5];
            int sum[] = new int[5];
            for (int i = 0; i < 5; i++) {
                c[i] = Integer.parseInt(in.next());
            }


            for (int i = 0; i < 5; i++) {
                sum[i] = c[i];
                for (int j = 0; j < 5; j++) {
                    if (j != i) {
                        if (c[j] % 10 == 0) {
                            sum[i] += c[j];
                        } else {
                            sum[i] += c[j] + 10 - c[j] % 10;
                        }
                    }
                }
            }
            // 出力
            Arrays.sort(sum);
            out.println(sum[0]);

        }

    }
}
 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.Arrays; Arrays java.util 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);
        B solver = new B();
        solver.solve(1, in, out);
        out.close();
    }

    static class B {
        public void solve(int testNumber, Scanner in, PrintWriter out) {
            // 入力
            int c[] = new int[5];
            int sum[] = new int[5];
            for (int i = 0; i < 5; i++) {
                c[i] = Integer.parseInt(in.next());
            }


            for (int i = 0; i < 5; i++) {
                sum[i] = c[i];
                for (int j = 0; j < 5; j++) {
                    if (j != i) {
                        if (c[j] % 10 == 0) {
                            sum[i] += c[j];
                        } else {
                            sum[i] += c[j] + 10 - c[j] % 10;
                        }
                    }
                }
            }
            // 出力
            Arrays.sort(sum);
            out.println(sum[0]);

        }

    }
} 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);
        B solver = new B();
        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);
        B solver = new B();
        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) B solver = new B(); solver new B() solver.solve(1, in, out) solver.solve solver 1 in out out.close() out.close out String[] args args static class B {
        public void solve(int testNumber, Scanner in, PrintWriter out) {
            // 入力
            int c[] = new int[5];
            int sum[] = new int[5];
            for (int i = 0; i < 5; i++) {
                c[i] = Integer.parseInt(in.next());
            }


            for (int i = 0; i < 5; i++) {
                sum[i] = c[i];
                for (int j = 0; j < 5; j++) {
                    if (j != i) {
                        if (c[j] % 10 == 0) {
                            sum[i] += c[j];
                        } else {
                            sum[i] += c[j] + 10 - c[j] % 10;
                        }
                    }
                }
            }
            // 出力
            Arrays.sort(sum);
            out.println(sum[0]);

        }

    } B public void solve(int testNumber, Scanner in, PrintWriter out) {
            // 入力
            int c[] = new int[5];
            int sum[] = new int[5];
            for (int i = 0; i < 5; i++) {
                c[i] = Integer.parseInt(in.next());
            }


            for (int i = 0; i < 5; i++) {
                sum[i] = c[i];
                for (int j = 0; j < 5; j++) {
                    if (j != i) {
                        if (c[j] % 10 == 0) {
                            sum[i] += c[j];
                        } else {
                            sum[i] += c[j] + 10 - c[j] % 10;
                        }
                    }
                }
            }
            // 出力
            Arrays.sort(sum);
            out.println(sum[0]);

        } solve {
            // 入力
            int c[] = new int[5];
            int sum[] = new int[5];
            for (int i = 0; i < 5; i++) {
                c[i] = Integer.parseInt(in.next());
            }


            for (int i = 0; i < 5; i++) {
                sum[i] = c[i];
                for (int j = 0; j < 5; j++) {
                    if (j != i) {
                        if (c[j] % 10 == 0) {
                            sum[i] += c[j];
                        } else {
                            sum[i] += c[j] + 10 - c[j] % 10;
                        }
                    }
                }
            }
            // 出力
            Arrays.sort(sum);
            out.println(sum[0]);

        } int c[] = new int[5]; c new int[5] 5 int sum[] = new int[5]; sum new int[5] 5 for (int i = 0; i < 5; i++) {
                c[i] = Integer.parseInt(in.next());
            } int i = 0; int i = 0; i 0 i < 5 i 5 i++ i++ i {
                c[i] = Integer.parseInt(in.next());
            } {
                c[i] = Integer.parseInt(in.next());
            } c[i] = Integer.parseInt(in.next()) c[i] c i Integer.parseInt(in.next()) Integer.parseInt Integer in.next() in.next in for (int i = 0; i < 5; i++) {
                sum[i] = c[i];
                for (int j = 0; j < 5; j++) {
                    if (j != i) {
                        if (c[j] % 10 == 0) {
                            sum[i] += c[j];
                        } else {
                            sum[i] += c[j] + 10 - c[j] % 10;
                        }
                    }
                }
            } int i = 0; int i = 0; i 0 i < 5 i 5 i++ i++ i {
                sum[i] = c[i];
                for (int j = 0; j < 5; j++) {
                    if (j != i) {
                        if (c[j] % 10 == 0) {
                            sum[i] += c[j];
                        } else {
                            sum[i] += c[j] + 10 - c[j] % 10;
                        }
                    }
                }
            } {
                sum[i] = c[i];
                for (int j = 0; j < 5; j++) {
                    if (j != i) {
                        if (c[j] % 10 == 0) {
                            sum[i] += c[j];
                        } else {
                            sum[i] += c[j] + 10 - c[j] % 10;
                        }
                    }
                }
            } sum[i] = c[i] sum[i] sum i c[i] c i for (int j = 0; j < 5; j++) {
                    if (j != i) {
                        if (c[j] % 10 == 0) {
                            sum[i] += c[j];
                        } else {
                            sum[i] += c[j] + 10 - c[j] % 10;
                        }
                    }
                } int j = 0; int j = 0; j 0 j < 5 j 5 j++ j++ j {
                    if (j != i) {
                        if (c[j] % 10 == 0) {
                            sum[i] += c[j];
                        } else {
                            sum[i] += c[j] + 10 - c[j] % 10;
                        }
                    }
                } {
                    if (j != i) {
                        if (c[j] % 10 == 0) {
                            sum[i] += c[j];
                        } else {
                            sum[i] += c[j] + 10 - c[j] % 10;
                        }
                    }
                } if (j != i) {
                        if (c[j] % 10 == 0) {
                            sum[i] += c[j];
                        } else {
                            sum[i] += c[j] + 10 - c[j] % 10;
                        }
                    } j != i j i {
                        if (c[j] % 10 == 0) {
                            sum[i] += c[j];
                        } else {
                            sum[i] += c[j] + 10 - c[j] % 10;
                        }
                    } if (c[j] % 10 == 0) {
                            sum[i] += c[j];
                        } else {
                            sum[i] += c[j] + 10 - c[j] % 10;
                        } c[j] % 10 == 0 c[j] % 10 c[j] c j 10 0 {
                            sum[i] += c[j];
                        } sum[i] += c[j] sum[i] sum i c[j] c j {
                            sum[i] += c[j] + 10 - c[j] % 10;
                        } sum[i] += c[j] + 10 - c[j] % 10 sum[i] sum i c[j] + 10 - c[j] % 10 c[j] + 10 c[j] c j 10 c[j] % 10 c[j] c j 10 Arrays.sort(sum) Arrays.sort Arrays sum out.println(sum[0]) out.println out sum[0] sum 0 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);
        B solver = new B();
        solver.solve(1, in, out);
        out.close();
    }

    static class B {
        public void solve(int testNumber, Scanner in, PrintWriter out) {
            // 入力
            int c[] = new int[5];
            int sum[] = new int[5];
            for (int i = 0; i < 5; i++) {
                c[i] = Integer.parseInt(in.next());
            }


            for (int i = 0; i < 5; i++) {
                sum[i] = c[i];
                for (int j = 0; j < 5; j++) {
                    if (j != i) {
                        if (c[j] % 10 == 0) {
                            sum[i] += c[j];
                        } else {
                            sum[i] += c[j] + 10 - c[j] % 10;
                        }
                    }
                }
            }
            // 出力
            Arrays.sort(sum);
            out.println(sum[0]);

        }

    }
} 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);
        B solver = new B();
        solver.solve(1, in, out);
        out.close();
    }

    static class B {
        public void solve(int testNumber, Scanner in, PrintWriter out) {
            // 入力
            int c[] = new int[5];
            int sum[] = new int[5];
            for (int i = 0; i < 5; i++) {
                c[i] = Integer.parseInt(in.next());
            }


            for (int i = 0; i < 5; i++) {
                sum[i] = c[i];
                for (int j = 0; j < 5; j++) {
                    if (j != i) {
                        if (c[j] % 10 == 0) {
                            sum[i] += c[j];
                        } else {
                            sum[i] += c[j] + 10 - c[j] % 10;
                        }
                    }
                }
            }
            // 出力
            Arrays.sort(sum);
            out.println(sum[0]);

        }

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

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 */
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);
        B solver = new B();
        solver.solve(1, in, out);
        out.close();
    }

    static class B {
        public void solve(int testNumber, Scanner in, PrintWriter out) {
            // 入力
            int c[] = new int[5];
            int sum[] = new int[5];
            for (int i = 0; i < 5; i++) {
                c[i] = Integer.parseInt(in.next());
            }


            for (int i = 0; i < 5; i++) {
                sum[i] = c[i];
                for (int j = 0; j < 5; j++) {
                    if (j != i) {
                        if (c[j] % 10 == 0) {
                            sum[i] += c[j];
                        } else {
                            sum[i] += c[j] + 10 - c[j] % 10;
                        }
                    }
                }
            }
            // 出力
            Arrays.sort(sum);
            out.println(sum[0]);

        }

    }
}

