import java.util.*;

public class Main {
    public static void main(String[] args) throws Exception {
        Scanner sc = new Scanner(System.in);
        int[] dish = new int[5];
        int maxIndex = 0;
        int max = 0;
        int sum = 0;
        for (int i = 0; i < 5; i++) {
            dish[i] = sc.nextInt();
        }
        for (int i = 0; i < 5; i++) {
            int order = dish[i];
            while (order >= dish[i] && order % 10 != 0) {
                order++;
            }
            if (max < order - dish[i]) {
                max = order - dish[i];
                maxIndex = i;
            }
        }
        for (int i = 0; i < 5; i++) {
            if (i == maxIndex) continue;
            if (dish[i] % 10 != 0) {
                while (dish[i] % 10 != 0) {
                    dish[i]++;
                }
            }
        }
        for (int tmp : dish) {
            sum += tmp;
        }
        System.out.println(sum);
    }
} import java.util.*; util.* java public class Main {
    public static void main(String[] args) throws Exception {
        Scanner sc = new Scanner(System.in);
        int[] dish = new int[5];
        int maxIndex = 0;
        int max = 0;
        int sum = 0;
        for (int i = 0; i < 5; i++) {
            dish[i] = sc.nextInt();
        }
        for (int i = 0; i < 5; i++) {
            int order = dish[i];
            while (order >= dish[i] && order % 10 != 0) {
                order++;
            }
            if (max < order - dish[i]) {
                max = order - dish[i];
                maxIndex = i;
            }
        }
        for (int i = 0; i < 5; i++) {
            if (i == maxIndex) continue;
            if (dish[i] % 10 != 0) {
                while (dish[i] % 10 != 0) {
                    dish[i]++;
                }
            }
        }
        for (int tmp : dish) {
            sum += tmp;
        }
        System.out.println(sum);
    }
} Main public static void main(String[] args) throws Exception {
        Scanner sc = new Scanner(System.in);
        int[] dish = new int[5];
        int maxIndex = 0;
        int max = 0;
        int sum = 0;
        for (int i = 0; i < 5; i++) {
            dish[i] = sc.nextInt();
        }
        for (int i = 0; i < 5; i++) {
            int order = dish[i];
            while (order >= dish[i] && order % 10 != 0) {
                order++;
            }
            if (max < order - dish[i]) {
                max = order - dish[i];
                maxIndex = i;
            }
        }
        for (int i = 0; i < 5; i++) {
            if (i == maxIndex) continue;
            if (dish[i] % 10 != 0) {
                while (dish[i] % 10 != 0) {
                    dish[i]++;
                }
            }
        }
        for (int tmp : dish) {
            sum += tmp;
        }
        System.out.println(sum);
    } main {
        Scanner sc = new Scanner(System.in);
        int[] dish = new int[5];
        int maxIndex = 0;
        int max = 0;
        int sum = 0;
        for (int i = 0; i < 5; i++) {
            dish[i] = sc.nextInt();
        }
        for (int i = 0; i < 5; i++) {
            int order = dish[i];
            while (order >= dish[i] && order % 10 != 0) {
                order++;
            }
            if (max < order - dish[i]) {
                max = order - dish[i];
                maxIndex = i;
            }
        }
        for (int i = 0; i < 5; i++) {
            if (i == maxIndex) continue;
            if (dish[i] % 10 != 0) {
                while (dish[i] % 10 != 0) {
                    dish[i]++;
                }
            }
        }
        for (int tmp : dish) {
            sum += tmp;
        }
        System.out.println(sum);
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int[] dish = new int[5]; dish new int[5] 5 int maxIndex = 0; maxIndex 0 int max = 0; max 0 int sum = 0; sum 0 for (int i = 0; i < 5; i++) {
            dish[i] = sc.nextInt();
        } int i = 0; int i = 0; i 0 i < 5 i 5 i++ i++ i {
            dish[i] = sc.nextInt();
        } {
            dish[i] = sc.nextInt();
        } dish[i] = sc.nextInt() dish[i] dish i sc.nextInt() sc.nextInt sc for (int i = 0; i < 5; i++) {
            int order = dish[i];
            while (order >= dish[i] && order % 10 != 0) {
                order++;
            }
            if (max < order - dish[i]) {
                max = order - dish[i];
                maxIndex = i;
            }
        } int i = 0; int i = 0; i 0 i < 5 i 5 i++ i++ i {
            int order = dish[i];
            while (order >= dish[i] && order % 10 != 0) {
                order++;
            }
            if (max < order - dish[i]) {
                max = order - dish[i];
                maxIndex = i;
            }
        } {
            int order = dish[i];
            while (order >= dish[i] && order % 10 != 0) {
                order++;
            }
            if (max < order - dish[i]) {
                max = order - dish[i];
                maxIndex = i;
            }
        } int order = dish[i]; order dish[i] dish i while (order >= dish[i] && order % 10 != 0) {
                order++;
            } order >= dish[i] && order % 10 != 0 order >= dish[i] order dish[i] dish i order % 10 != 0 order % 10 order 10 0 {
                order++;
            } order++ order if (max < order - dish[i]) {
                max = order - dish[i];
                maxIndex = i;
            } max < order - dish[i] max order - dish[i] order dish[i] dish i {
                max = order - dish[i];
                maxIndex = i;
            } max = order - dish[i] max order - dish[i] order dish[i] dish i maxIndex = i maxIndex i for (int i = 0; i < 5; i++) {
            if (i == maxIndex) continue;
            if (dish[i] % 10 != 0) {
                while (dish[i] % 10 != 0) {
                    dish[i]++;
                }
            }
        } int i = 0; int i = 0; i 0 i < 5 i 5 i++ i++ i {
            if (i == maxIndex) continue;
            if (dish[i] % 10 != 0) {
                while (dish[i] % 10 != 0) {
                    dish[i]++;
                }
            }
        } {
            if (i == maxIndex) continue;
            if (dish[i] % 10 != 0) {
                while (dish[i] % 10 != 0) {
                    dish[i]++;
                }
            }
        } if (i == maxIndex) continue; i == maxIndex i maxIndex continue; if (dish[i] % 10 != 0) {
                while (dish[i] % 10 != 0) {
                    dish[i]++;
                }
            } dish[i] % 10 != 0 dish[i] % 10 dish[i] dish i 10 0 {
                while (dish[i] % 10 != 0) {
                    dish[i]++;
                }
            } while (dish[i] % 10 != 0) {
                    dish[i]++;
                } dish[i] % 10 != 0 dish[i] % 10 dish[i] dish i 10 0 {
                    dish[i]++;
                } dish[i]++ dish[i] dish i for (int tmp : dish) {
            sum += tmp;
        } int tmp dish {
            sum += tmp;
        } {
            sum += tmp;
        } sum += tmp sum tmp 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);
        int[] dish = new int[5];
        int maxIndex = 0;
        int max = 0;
        int sum = 0;
        for (int i = 0; i < 5; i++) {
            dish[i] = sc.nextInt();
        }
        for (int i = 0; i < 5; i++) {
            int order = dish[i];
            while (order >= dish[i] && order % 10 != 0) {
                order++;
            }
            if (max < order - dish[i]) {
                max = order - dish[i];
                maxIndex = i;
            }
        }
        for (int i = 0; i < 5; i++) {
            if (i == maxIndex) continue;
            if (dish[i] % 10 != 0) {
                while (dish[i] % 10 != 0) {
                    dish[i]++;
                }
            }
        }
        for (int tmp : dish) {
            sum += tmp;
        }
        System.out.println(sum);
    }
} public class Main {
    public static void main(String[] args) throws Exception {
        Scanner sc = new Scanner(System.in);
        int[] dish = new int[5];
        int maxIndex = 0;
        int max = 0;
        int sum = 0;
        for (int i = 0; i < 5; i++) {
            dish[i] = sc.nextInt();
        }
        for (int i = 0; i < 5; i++) {
            int order = dish[i];
            while (order >= dish[i] && order % 10 != 0) {
                order++;
            }
            if (max < order - dish[i]) {
                max = order - dish[i];
                maxIndex = i;
            }
        }
        for (int i = 0; i < 5; i++) {
            if (i == maxIndex) continue;
            if (dish[i] % 10 != 0) {
                while (dish[i] % 10 != 0) {
                    dish[i]++;
                }
            }
        }
        for (int tmp : dish) {
            sum += tmp;
        }
        System.out.println(sum);
    }
} Main
import java.util.*;

public class Main {
    public static void main(String[] args) throws Exception {
        Scanner sc = new Scanner(System.in);
        int[] dish = new int[5];
        int maxIndex = 0;
        int max = 0;
        int sum = 0;
        for (int i = 0; i < 5; i++) {
            dish[i] = sc.nextInt();
        }
        for (int i = 0; i < 5; i++) {
            int order = dish[i];
            while (order >= dish[i] && order % 10 != 0) {
                order++;
            }
            if (max < order - dish[i]) {
                max = order - dish[i];
                maxIndex = i;
            }
        }
        for (int i = 0; i < 5; i++) {
            if (i == maxIndex) continue;
            if (dish[i] % 10 != 0) {
                while (dish[i] % 10 != 0) {
                    dish[i]++;
                }
            }
        }
        for (int tmp : dish) {
            sum += tmp;
        }
        System.out.println(sum);
    }
}
