import java.util.Scanner;

public class Main {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int[] abcde = new int[5];
        for (int i = 0; i < 5; i++) {
            abcde[i] = sc.nextInt();
        }
        int minIdx = 0;
        int min = 9;
        for (int i = 0; i < 5; i++) {
            String target = String.valueOf(abcde[i]);
            int t = Integer.parseInt(target.substring(target.length() - 1));
            if (t != 0 && t < min) {
                minIdx = i;
                min = t;
            }
        }
        int tmp = abcde[minIdx];
        abcde[minIdx] = abcde[4];
        abcde[4] = tmp;
        int sum = 0;
        for (int i = 0; i < abcde.length; i++) {
            int target = abcde[i];
            if (i == 4) {
                sum += target;
                continue;
            }
            if (target % 10 == 0) {
                sum += (target / 10) * 10;
                continue;
            }
            sum += (target / 10 + 1) * 10;
        }
        System.out.println(sum);
    }

} import java.util.Scanner; Scanner java.util public class Main {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int[] abcde = new int[5];
        for (int i = 0; i < 5; i++) {
            abcde[i] = sc.nextInt();
        }
        int minIdx = 0;
        int min = 9;
        for (int i = 0; i < 5; i++) {
            String target = String.valueOf(abcde[i]);
            int t = Integer.parseInt(target.substring(target.length() - 1));
            if (t != 0 && t < min) {
                minIdx = i;
                min = t;
            }
        }
        int tmp = abcde[minIdx];
        abcde[minIdx] = abcde[4];
        abcde[4] = tmp;
        int sum = 0;
        for (int i = 0; i < abcde.length; i++) {
            int target = abcde[i];
            if (i == 4) {
                sum += target;
                continue;
            }
            if (target % 10 == 0) {
                sum += (target / 10) * 10;
                continue;
            }
            sum += (target / 10 + 1) * 10;
        }
        System.out.println(sum);
    }

} Main public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int[] abcde = new int[5];
        for (int i = 0; i < 5; i++) {
            abcde[i] = sc.nextInt();
        }
        int minIdx = 0;
        int min = 9;
        for (int i = 0; i < 5; i++) {
            String target = String.valueOf(abcde[i]);
            int t = Integer.parseInt(target.substring(target.length() - 1));
            if (t != 0 && t < min) {
                minIdx = i;
                min = t;
            }
        }
        int tmp = abcde[minIdx];
        abcde[minIdx] = abcde[4];
        abcde[4] = tmp;
        int sum = 0;
        for (int i = 0; i < abcde.length; i++) {
            int target = abcde[i];
            if (i == 4) {
                sum += target;
                continue;
            }
            if (target % 10 == 0) {
                sum += (target / 10) * 10;
                continue;
            }
            sum += (target / 10 + 1) * 10;
        }
        System.out.println(sum);
    } main {
        Scanner sc = new Scanner(System.in);
        int[] abcde = new int[5];
        for (int i = 0; i < 5; i++) {
            abcde[i] = sc.nextInt();
        }
        int minIdx = 0;
        int min = 9;
        for (int i = 0; i < 5; i++) {
            String target = String.valueOf(abcde[i]);
            int t = Integer.parseInt(target.substring(target.length() - 1));
            if (t != 0 && t < min) {
                minIdx = i;
                min = t;
            }
        }
        int tmp = abcde[minIdx];
        abcde[minIdx] = abcde[4];
        abcde[4] = tmp;
        int sum = 0;
        for (int i = 0; i < abcde.length; i++) {
            int target = abcde[i];
            if (i == 4) {
                sum += target;
                continue;
            }
            if (target % 10 == 0) {
                sum += (target / 10) * 10;
                continue;
            }
            sum += (target / 10 + 1) * 10;
        }
        System.out.println(sum);
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int[] abcde = new int[5]; abcde new int[5] 5 for (int i = 0; i < 5; i++) {
            abcde[i] = sc.nextInt();
        } int i = 0; int i = 0; i 0 i < 5 i 5 i++ i++ i {
            abcde[i] = sc.nextInt();
        } {
            abcde[i] = sc.nextInt();
        } abcde[i] = sc.nextInt() abcde[i] abcde i sc.nextInt() sc.nextInt sc int minIdx = 0; minIdx 0 int min = 9; min 9 for (int i = 0; i < 5; i++) {
            String target = String.valueOf(abcde[i]);
            int t = Integer.parseInt(target.substring(target.length() - 1));
            if (t != 0 && t < min) {
                minIdx = i;
                min = t;
            }
        } int i = 0; int i = 0; i 0 i < 5 i 5 i++ i++ i {
            String target = String.valueOf(abcde[i]);
            int t = Integer.parseInt(target.substring(target.length() - 1));
            if (t != 0 && t < min) {
                minIdx = i;
                min = t;
            }
        } {
            String target = String.valueOf(abcde[i]);
            int t = Integer.parseInt(target.substring(target.length() - 1));
            if (t != 0 && t < min) {
                minIdx = i;
                min = t;
            }
        } String target = String.valueOf(abcde[i]); target String.valueOf(abcde[i]) String.valueOf String abcde[i] abcde i int t = Integer.parseInt(target.substring(target.length() - 1)); t Integer.parseInt(target.substring(target.length() - 1)) Integer.parseInt Integer target.substring(target.length() - 1) target.substring target target.length() - 1 target.length() target.length target 1 if (t != 0 && t < min) {
                minIdx = i;
                min = t;
            } t != 0 && t < min t != 0 t 0 t < min t min {
                minIdx = i;
                min = t;
            } minIdx = i minIdx i min = t min t int tmp = abcde[minIdx]; tmp abcde[minIdx] abcde minIdx abcde[minIdx] = abcde[4] abcde[minIdx] abcde minIdx abcde[4] abcde 4 abcde[4] = tmp abcde[4] abcde 4 tmp int sum = 0; sum 0 for (int i = 0; i < abcde.length; i++) {
            int target = abcde[i];
            if (i == 4) {
                sum += target;
                continue;
            }
            if (target % 10 == 0) {
                sum += (target / 10) * 10;
                continue;
            }
            sum += (target / 10 + 1) * 10;
        } int i = 0; int i = 0; i 0 i < abcde.length i abcde.length abcde abcde.length i++ i++ i {
            int target = abcde[i];
            if (i == 4) {
                sum += target;
                continue;
            }
            if (target % 10 == 0) {
                sum += (target / 10) * 10;
                continue;
            }
            sum += (target / 10 + 1) * 10;
        } {
            int target = abcde[i];
            if (i == 4) {
                sum += target;
                continue;
            }
            if (target % 10 == 0) {
                sum += (target / 10) * 10;
                continue;
            }
            sum += (target / 10 + 1) * 10;
        } int target = abcde[i]; target abcde[i] abcde i if (i == 4) {
                sum += target;
                continue;
            } i == 4 i 4 {
                sum += target;
                continue;
            } sum += target sum target continue; if (target % 10 == 0) {
                sum += (target / 10) * 10;
                continue;
            } target % 10 == 0 target % 10 target 10 0 {
                sum += (target / 10) * 10;
                continue;
            } sum += (target / 10) * 10 sum (target / 10) * 10 (target / 10) target 10 10 continue; sum += (target / 10 + 1) * 10 sum (target / 10 + 1) * 10 (target / 10 + 1) target / 10 target 10 1 10 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) {
        Scanner sc = new Scanner(System.in);
        int[] abcde = new int[5];
        for (int i = 0; i < 5; i++) {
            abcde[i] = sc.nextInt();
        }
        int minIdx = 0;
        int min = 9;
        for (int i = 0; i < 5; i++) {
            String target = String.valueOf(abcde[i]);
            int t = Integer.parseInt(target.substring(target.length() - 1));
            if (t != 0 && t < min) {
                minIdx = i;
                min = t;
            }
        }
        int tmp = abcde[minIdx];
        abcde[minIdx] = abcde[4];
        abcde[4] = tmp;
        int sum = 0;
        for (int i = 0; i < abcde.length; i++) {
            int target = abcde[i];
            if (i == 4) {
                sum += target;
                continue;
            }
            if (target % 10 == 0) {
                sum += (target / 10) * 10;
                continue;
            }
            sum += (target / 10 + 1) * 10;
        }
        System.out.println(sum);
    }

} public class Main {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int[] abcde = new int[5];
        for (int i = 0; i < 5; i++) {
            abcde[i] = sc.nextInt();
        }
        int minIdx = 0;
        int min = 9;
        for (int i = 0; i < 5; i++) {
            String target = String.valueOf(abcde[i]);
            int t = Integer.parseInt(target.substring(target.length() - 1));
            if (t != 0 && t < min) {
                minIdx = i;
                min = t;
            }
        }
        int tmp = abcde[minIdx];
        abcde[minIdx] = abcde[4];
        abcde[4] = tmp;
        int sum = 0;
        for (int i = 0; i < abcde.length; i++) {
            int target = abcde[i];
            if (i == 4) {
                sum += target;
                continue;
            }
            if (target % 10 == 0) {
                sum += (target / 10) * 10;
                continue;
            }
            sum += (target / 10 + 1) * 10;
        }
        System.out.println(sum);
    }

} Main
import java.util.Scanner;

public class Main {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int[] abcde = new int[5];
        for (int i = 0; i < 5; i++) {
            abcde[i] = sc.nextInt();
        }
        int minIdx = 0;
        int min = 9;
        for (int i = 0; i < 5; i++) {
            String target = String.valueOf(abcde[i]);
            int t = Integer.parseInt(target.substring(target.length() - 1));
            if (t != 0 && t < min) {
                minIdx = i;
                min = t;
            }
        }
        int tmp = abcde[minIdx];
        abcde[minIdx] = abcde[4];
        abcde[4] = tmp;
        int sum = 0;
        for (int i = 0; i < abcde.length; i++) {
            int target = abcde[i];
            if (i == 4) {
                sum += target;
                continue;
            }
            if (target % 10 == 0) {
                sum += (target / 10) * 10;
                continue;
            }
            sum += (target / 10 + 1) * 10;
        }
        System.out.println(sum);
    }

}
