import java.util.*;

public class Main {

    public static void main(String[] args) {
	    // write your code here
        Scanner sc = new Scanner(System.in);

        double[] list = new double[5];

        int min = 10;
        int minIndex = -1;

        for(int i = 0; i < 5; i++) {
            int value = sc.nextInt();
            int amari = value % 10;
            if (amari != 0 && amari < min) {
                min = amari;
                minIndex = i;
            }
            list[i] = value;
        }

        int ans = 0;

        for(int i = 0; i < 5; i++) {
            if (i == minIndex) {
                ans += list[i];
            } else {
                ans += (int) Math.ceil(list[i] / 10) * 10;
            }
        }

        // 出力
        System.out.println(ans);
    }
} import java.util.*; util.* java public class Main {

    public static void main(String[] args) {
	    // write your code here
        Scanner sc = new Scanner(System.in);

        double[] list = new double[5];

        int min = 10;
        int minIndex = -1;

        for(int i = 0; i < 5; i++) {
            int value = sc.nextInt();
            int amari = value % 10;
            if (amari != 0 && amari < min) {
                min = amari;
                minIndex = i;
            }
            list[i] = value;
        }

        int ans = 0;

        for(int i = 0; i < 5; i++) {
            if (i == minIndex) {
                ans += list[i];
            } else {
                ans += (int) Math.ceil(list[i] / 10) * 10;
            }
        }

        // 出力
        System.out.println(ans);
    }
} Main public static void main(String[] args) {
	    // write your code here
        Scanner sc = new Scanner(System.in);

        double[] list = new double[5];

        int min = 10;
        int minIndex = -1;

        for(int i = 0; i < 5; i++) {
            int value = sc.nextInt();
            int amari = value % 10;
            if (amari != 0 && amari < min) {
                min = amari;
                minIndex = i;
            }
            list[i] = value;
        }

        int ans = 0;

        for(int i = 0; i < 5; i++) {
            if (i == minIndex) {
                ans += list[i];
            } else {
                ans += (int) Math.ceil(list[i] / 10) * 10;
            }
        }

        // 出力
        System.out.println(ans);
    } main {
	    // write your code here
        Scanner sc = new Scanner(System.in);

        double[] list = new double[5];

        int min = 10;
        int minIndex = -1;

        for(int i = 0; i < 5; i++) {
            int value = sc.nextInt();
            int amari = value % 10;
            if (amari != 0 && amari < min) {
                min = amari;
                minIndex = i;
            }
            list[i] = value;
        }

        int ans = 0;

        for(int i = 0; i < 5; i++) {
            if (i == minIndex) {
                ans += list[i];
            } else {
                ans += (int) Math.ceil(list[i] / 10) * 10;
            }
        }

        // 出力
        System.out.println(ans);
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) double[] list = new double[5]; list new double[5] 5 int min = 10; min 10 int minIndex = -1; minIndex -1 1 for(int i = 0; i < 5; i++) {
            int value = sc.nextInt();
            int amari = value % 10;
            if (amari != 0 && amari < min) {
                min = amari;
                minIndex = i;
            }
            list[i] = value;
        } int i = 0; int i = 0; i 0 i < 5 i 5 i++ i++ i {
            int value = sc.nextInt();
            int amari = value % 10;
            if (amari != 0 && amari < min) {
                min = amari;
                minIndex = i;
            }
            list[i] = value;
        } {
            int value = sc.nextInt();
            int amari = value % 10;
            if (amari != 0 && amari < min) {
                min = amari;
                minIndex = i;
            }
            list[i] = value;
        } int value = sc.nextInt(); value sc.nextInt() sc.nextInt sc int amari = value % 10; amari value % 10 value 10 if (amari != 0 && amari < min) {
                min = amari;
                minIndex = i;
            } amari != 0 && amari < min amari != 0 amari 0 amari < min amari min {
                min = amari;
                minIndex = i;
            } min = amari min amari minIndex = i minIndex i list[i] = value list[i] list i value int ans = 0; ans 0 for(int i = 0; i < 5; i++) {
            if (i == minIndex) {
                ans += list[i];
            } else {
                ans += (int) Math.ceil(list[i] / 10) * 10;
            }
        } int i = 0; int i = 0; i 0 i < 5 i 5 i++ i++ i {
            if (i == minIndex) {
                ans += list[i];
            } else {
                ans += (int) Math.ceil(list[i] / 10) * 10;
            }
        } {
            if (i == minIndex) {
                ans += list[i];
            } else {
                ans += (int) Math.ceil(list[i] / 10) * 10;
            }
        } if (i == minIndex) {
                ans += list[i];
            } else {
                ans += (int) Math.ceil(list[i] / 10) * 10;
            } i == minIndex i minIndex {
                ans += list[i];
            } ans += list[i] ans list[i] list i {
                ans += (int) Math.ceil(list[i] / 10) * 10;
            } ans += (int) Math.ceil(list[i] / 10) * 10 ans (int) Math.ceil(list[i] / 10) * 10 (int) Math.ceil(list[i] / 10) Math.ceil Math list[i] / 10 list[i] list i 10 10 System.out.println(ans) System.out.println System.out System System.out ans String[] args args public class Main {

    public static void main(String[] args) {
	    // write your code here
        Scanner sc = new Scanner(System.in);

        double[] list = new double[5];

        int min = 10;
        int minIndex = -1;

        for(int i = 0; i < 5; i++) {
            int value = sc.nextInt();
            int amari = value % 10;
            if (amari != 0 && amari < min) {
                min = amari;
                minIndex = i;
            }
            list[i] = value;
        }

        int ans = 0;

        for(int i = 0; i < 5; i++) {
            if (i == minIndex) {
                ans += list[i];
            } else {
                ans += (int) Math.ceil(list[i] / 10) * 10;
            }
        }

        // 出力
        System.out.println(ans);
    }
} public class Main {

    public static void main(String[] args) {
	    // write your code here
        Scanner sc = new Scanner(System.in);

        double[] list = new double[5];

        int min = 10;
        int minIndex = -1;

        for(int i = 0; i < 5; i++) {
            int value = sc.nextInt();
            int amari = value % 10;
            if (amari != 0 && amari < min) {
                min = amari;
                minIndex = i;
            }
            list[i] = value;
        }

        int ans = 0;

        for(int i = 0; i < 5; i++) {
            if (i == minIndex) {
                ans += list[i];
            } else {
                ans += (int) Math.ceil(list[i] / 10) * 10;
            }
        }

        // 出力
        System.out.println(ans);
    }
} Main
import java.util.*;

public class Main {

    public static void main(String[] args) {
	    // write your code here
        Scanner sc = new Scanner(System.in);

        double[] list = new double[5];

        int min = 10;
        int minIndex = -1;

        for(int i = 0; i < 5; i++) {
            int value = sc.nextInt();
            int amari = value % 10;
            if (amari != 0 && amari < min) {
                min = amari;
                minIndex = i;
            }
            list[i] = value;
        }

        int ans = 0;

        for(int i = 0; i < 5; i++) {
            if (i == minIndex) {
                ans += list[i];
            } else {
                ans += (int) Math.ceil(list[i] / 10) * 10;
            }
        }

        // 出力
        System.out.println(ans);
    }
}