import java.util.*;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);

        int[] time = new int[5];
        int sum = 0;
        int min = 10;
        for (int i = 0; i < 5; i++) {
            time[i] = sc.nextInt();
        }
        for (int i = 0; i < 5; i++) {
            if (time[i] % 10 == 0)
                sum += time[i];
            else
                sum += time[i] + 10 - time[i] % 10;
        }
        for (int i = 0; i < 5; i++) {
            if (time[i] % 10 != 0) {
                if (min > time[i] % 10) {
                    min = time[i] % 10;
                }
            }
        }
        System.out.println(sum - (10 - min));
    }
} import java.util.*; util.* java public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);

        int[] time = new int[5];
        int sum = 0;
        int min = 10;
        for (int i = 0; i < 5; i++) {
            time[i] = sc.nextInt();
        }
        for (int i = 0; i < 5; i++) {
            if (time[i] % 10 == 0)
                sum += time[i];
            else
                sum += time[i] + 10 - time[i] % 10;
        }
        for (int i = 0; i < 5; i++) {
            if (time[i] % 10 != 0) {
                if (min > time[i] % 10) {
                    min = time[i] % 10;
                }
            }
        }
        System.out.println(sum - (10 - min));
    }
} Main public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);

        int[] time = new int[5];
        int sum = 0;
        int min = 10;
        for (int i = 0; i < 5; i++) {
            time[i] = sc.nextInt();
        }
        for (int i = 0; i < 5; i++) {
            if (time[i] % 10 == 0)
                sum += time[i];
            else
                sum += time[i] + 10 - time[i] % 10;
        }
        for (int i = 0; i < 5; i++) {
            if (time[i] % 10 != 0) {
                if (min > time[i] % 10) {
                    min = time[i] % 10;
                }
            }
        }
        System.out.println(sum - (10 - min));
    } main {
        Scanner sc = new Scanner(System.in);

        int[] time = new int[5];
        int sum = 0;
        int min = 10;
        for (int i = 0; i < 5; i++) {
            time[i] = sc.nextInt();
        }
        for (int i = 0; i < 5; i++) {
            if (time[i] % 10 == 0)
                sum += time[i];
            else
                sum += time[i] + 10 - time[i] % 10;
        }
        for (int i = 0; i < 5; i++) {
            if (time[i] % 10 != 0) {
                if (min > time[i] % 10) {
                    min = time[i] % 10;
                }
            }
        }
        System.out.println(sum - (10 - min));
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int[] time = new int[5]; time new int[5] 5 int sum = 0; sum 0 int min = 10; min 10 for (int i = 0; i < 5; i++) {
            time[i] = sc.nextInt();
        } int i = 0; int i = 0; i 0 i < 5 i 5 i++ i++ i {
            time[i] = sc.nextInt();
        } {
            time[i] = sc.nextInt();
        } time[i] = sc.nextInt() time[i] time i sc.nextInt() sc.nextInt sc for (int i = 0; i < 5; i++) {
            if (time[i] % 10 == 0)
                sum += time[i];
            else
                sum += time[i] + 10 - time[i] % 10;
        } int i = 0; int i = 0; i 0 i < 5 i 5 i++ i++ i {
            if (time[i] % 10 == 0)
                sum += time[i];
            else
                sum += time[i] + 10 - time[i] % 10;
        } {
            if (time[i] % 10 == 0)
                sum += time[i];
            else
                sum += time[i] + 10 - time[i] % 10;
        } if (time[i] % 10 == 0)
                sum += time[i];
            else
                sum += time[i] + 10 - time[i] % 10; time[i] % 10 == 0 time[i] % 10 time[i] time i 10 0 sum += time[i] sum time[i] time i sum += time[i] + 10 - time[i] % 10 sum time[i] + 10 - time[i] % 10 time[i] + 10 time[i] time i 10 time[i] % 10 time[i] time i 10 for (int i = 0; i < 5; i++) {
            if (time[i] % 10 != 0) {
                if (min > time[i] % 10) {
                    min = time[i] % 10;
                }
            }
        } int i = 0; int i = 0; i 0 i < 5 i 5 i++ i++ i {
            if (time[i] % 10 != 0) {
                if (min > time[i] % 10) {
                    min = time[i] % 10;
                }
            }
        } {
            if (time[i] % 10 != 0) {
                if (min > time[i] % 10) {
                    min = time[i] % 10;
                }
            }
        } if (time[i] % 10 != 0) {
                if (min > time[i] % 10) {
                    min = time[i] % 10;
                }
            } time[i] % 10 != 0 time[i] % 10 time[i] time i 10 0 {
                if (min > time[i] % 10) {
                    min = time[i] % 10;
                }
            } if (min > time[i] % 10) {
                    min = time[i] % 10;
                } min > time[i] % 10 min time[i] % 10 time[i] time i 10 {
                    min = time[i] % 10;
                } min = time[i] % 10 min time[i] % 10 time[i] time i 10 System.out.println(sum - (10 - min)) System.out.println System.out System System.out sum - (10 - min) sum (10 - min) 10 min String[] args args public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);

        int[] time = new int[5];
        int sum = 0;
        int min = 10;
        for (int i = 0; i < 5; i++) {
            time[i] = sc.nextInt();
        }
        for (int i = 0; i < 5; i++) {
            if (time[i] % 10 == 0)
                sum += time[i];
            else
                sum += time[i] + 10 - time[i] % 10;
        }
        for (int i = 0; i < 5; i++) {
            if (time[i] % 10 != 0) {
                if (min > time[i] % 10) {
                    min = time[i] % 10;
                }
            }
        }
        System.out.println(sum - (10 - min));
    }
} public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);

        int[] time = new int[5];
        int sum = 0;
        int min = 10;
        for (int i = 0; i < 5; i++) {
            time[i] = sc.nextInt();
        }
        for (int i = 0; i < 5; i++) {
            if (time[i] % 10 == 0)
                sum += time[i];
            else
                sum += time[i] + 10 - time[i] % 10;
        }
        for (int i = 0; i < 5; i++) {
            if (time[i] % 10 != 0) {
                if (min > time[i] % 10) {
                    min = time[i] % 10;
                }
            }
        }
        System.out.println(sum - (10 - min));
    }
} Main
import java.util.*;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);

        int[] time = new int[5];
        int sum = 0;
        int min = 10;
        for (int i = 0; i < 5; i++) {
            time[i] = sc.nextInt();
        }
        for (int i = 0; i < 5; i++) {
            if (time[i] % 10 == 0)
                sum += time[i];
            else
                sum += time[i] + 10 - time[i] % 10;
        }
        for (int i = 0; i < 5; i++) {
            if (time[i] % 10 != 0) {
                if (min > time[i] % 10) {
                    min = time[i] % 10;
                }
            }
        }
        System.out.println(sum - (10 - min));
    }
}