import java.util.Scanner;

public class Main {

    private static Scanner sc = new Scanner(System.in);

    public static void main(String args[]) {

        int[] time = new int[5];
        for (int i=0; i < 5; i++)
            time[i] = sc.nextInt();

        int minIndex = 0;
        int minModulusTime = 10;
        for (int i=0; i < 5; i++) {
            if (modulusTime(time[i]) < minModulusTime) {
                minIndex = i;
                minModulusTime = modulusTime(time[i]);
            }
        }

        int count = 0;

        for (int i=0; i < 5; i++) {
            if (i != minIndex)
                count += actualTime(time[i]);
            else
                count += time[i];
        }

        System.out.println(count);

    }

    private static int modulusTime(int time) {
        if (time % 10 == 0) return 10;
        return time % 10;
    }

    private static int actualTime(int time) {
        if (time % 10 == 0) return time;
        return time + (10 - time % 10);
    }

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

    private static Scanner sc = new Scanner(System.in);

    public static void main(String args[]) {

        int[] time = new int[5];
        for (int i=0; i < 5; i++)
            time[i] = sc.nextInt();

        int minIndex = 0;
        int minModulusTime = 10;
        for (int i=0; i < 5; i++) {
            if (modulusTime(time[i]) < minModulusTime) {
                minIndex = i;
                minModulusTime = modulusTime(time[i]);
            }
        }

        int count = 0;

        for (int i=0; i < 5; i++) {
            if (i != minIndex)
                count += actualTime(time[i]);
            else
                count += time[i];
        }

        System.out.println(count);

    }

    private static int modulusTime(int time) {
        if (time % 10 == 0) return 10;
        return time % 10;
    }

    private static int actualTime(int time) {
        if (time % 10 == 0) return time;
        return time + (10 - time % 10);
    }

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

        int[] time = new int[5];
        for (int i=0; i < 5; i++)
            time[i] = sc.nextInt();

        int minIndex = 0;
        int minModulusTime = 10;
        for (int i=0; i < 5; i++) {
            if (modulusTime(time[i]) < minModulusTime) {
                minIndex = i;
                minModulusTime = modulusTime(time[i]);
            }
        }

        int count = 0;

        for (int i=0; i < 5; i++) {
            if (i != minIndex)
                count += actualTime(time[i]);
            else
                count += time[i];
        }

        System.out.println(count);

    } main {

        int[] time = new int[5];
        for (int i=0; i < 5; i++)
            time[i] = sc.nextInt();

        int minIndex = 0;
        int minModulusTime = 10;
        for (int i=0; i < 5; i++) {
            if (modulusTime(time[i]) < minModulusTime) {
                minIndex = i;
                minModulusTime = modulusTime(time[i]);
            }
        }

        int count = 0;

        for (int i=0; i < 5; i++) {
            if (i != minIndex)
                count += actualTime(time[i]);
            else
                count += time[i];
        }

        System.out.println(count);

    } int[] time = new int[5]; time new int[5] 5 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] time i sc.nextInt() sc.nextInt sc int minIndex = 0; minIndex 0 int minModulusTime = 10; minModulusTime 10 for (int i=0; i < 5; i++) {
            if (modulusTime(time[i]) < minModulusTime) {
                minIndex = i;
                minModulusTime = modulusTime(time[i]);
            }
        } int i=0; int i=0; i 0 i < 5 i 5 i++ i++ i {
            if (modulusTime(time[i]) < minModulusTime) {
                minIndex = i;
                minModulusTime = modulusTime(time[i]);
            }
        } {
            if (modulusTime(time[i]) < minModulusTime) {
                minIndex = i;
                minModulusTime = modulusTime(time[i]);
            }
        } if (modulusTime(time[i]) < minModulusTime) {
                minIndex = i;
                minModulusTime = modulusTime(time[i]);
            } modulusTime(time[i]) < minModulusTime modulusTime(time[i]) modulusTime time[i] time i minModulusTime {
                minIndex = i;
                minModulusTime = modulusTime(time[i]);
            } minIndex = i minIndex i minModulusTime = modulusTime(time[i]) minModulusTime modulusTime(time[i]) modulusTime time[i] time i int count = 0; count 0 for (int i=0; i < 5; i++) {
            if (i != minIndex)
                count += actualTime(time[i]);
            else
                count += time[i];
        } int i=0; int i=0; i 0 i < 5 i 5 i++ i++ i {
            if (i != minIndex)
                count += actualTime(time[i]);
            else
                count += time[i];
        } {
            if (i != minIndex)
                count += actualTime(time[i]);
            else
                count += time[i];
        } if (i != minIndex)
                count += actualTime(time[i]);
            else
                count += time[i]; i != minIndex i minIndex count += actualTime(time[i]) count actualTime(time[i]) actualTime time[i] time i count += time[i] count time[i] time i System.out.println(count) System.out.println System.out System System.out count String args[] args private static int modulusTime(int time) {
        if (time % 10 == 0) return 10;
        return time % 10;
    } modulusTime {
        if (time % 10 == 0) return 10;
        return time % 10;
    } if (time % 10 == 0) return 10; time % 10 == 0 time % 10 time 10 0 return 10; 10 return time % 10; time % 10 time 10 int time time private static int actualTime(int time) {
        if (time % 10 == 0) return time;
        return time + (10 - time % 10);
    } actualTime {
        if (time % 10 == 0) return time;
        return time + (10 - time % 10);
    } if (time % 10 == 0) return time; time % 10 == 0 time % 10 time 10 0 return time; time return time + (10 - time % 10); time + (10 - time % 10) time (10 - time % 10) 10 time % 10 time 10 int time time public class Main {

    private static Scanner sc = new Scanner(System.in);

    public static void main(String args[]) {

        int[] time = new int[5];
        for (int i=0; i < 5; i++)
            time[i] = sc.nextInt();

        int minIndex = 0;
        int minModulusTime = 10;
        for (int i=0; i < 5; i++) {
            if (modulusTime(time[i]) < minModulusTime) {
                minIndex = i;
                minModulusTime = modulusTime(time[i]);
            }
        }

        int count = 0;

        for (int i=0; i < 5; i++) {
            if (i != minIndex)
                count += actualTime(time[i]);
            else
                count += time[i];
        }

        System.out.println(count);

    }

    private static int modulusTime(int time) {
        if (time % 10 == 0) return 10;
        return time % 10;
    }

    private static int actualTime(int time) {
        if (time % 10 == 0) return time;
        return time + (10 - time % 10);
    }

} public class Main {

    private static Scanner sc = new Scanner(System.in);

    public static void main(String args[]) {

        int[] time = new int[5];
        for (int i=0; i < 5; i++)
            time[i] = sc.nextInt();

        int minIndex = 0;
        int minModulusTime = 10;
        for (int i=0; i < 5; i++) {
            if (modulusTime(time[i]) < minModulusTime) {
                minIndex = i;
                minModulusTime = modulusTime(time[i]);
            }
        }

        int count = 0;

        for (int i=0; i < 5; i++) {
            if (i != minIndex)
                count += actualTime(time[i]);
            else
                count += time[i];
        }

        System.out.println(count);

    }

    private static int modulusTime(int time) {
        if (time % 10 == 0) return 10;
        return time % 10;
    }

    private static int actualTime(int time) {
        if (time % 10 == 0) return time;
        return time + (10 - time % 10);
    }

} Main
import java.util.Scanner;

public class Main {

    private static Scanner sc = new Scanner(System.in);

    public static void main(String args[]) {

        int[] time = new int[5];
        for (int i=0; i < 5; i++)
            time[i] = sc.nextInt();

        int minIndex = 0;
        int minModulusTime = 10;
        for (int i=0; i < 5; i++) {
            if (modulusTime(time[i]) < minModulusTime) {
                minIndex = i;
                minModulusTime = modulusTime(time[i]);
            }
        }

        int count = 0;

        for (int i=0; i < 5; i++) {
            if (i != minIndex)
                count += actualTime(time[i]);
            else
                count += time[i];
        }

        System.out.println(count);

    }

    private static int modulusTime(int time) {
        if (time % 10 == 0) return 10;
        return time % 10;
    }

    private static int actualTime(int time) {
        if (time % 10 == 0) return time;
        return time + (10 - time % 10);
    }

}
