import java.util.Scanner;

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

        int rest = 11;
        int acc = 0;

        for(int i=0; i<5; i++){
            int tmp = scanner.nextInt();

            if(tmp % 10 < rest && tmp % 10 != 0){
                rest = tmp % 10;
            }

            acc += Math.ceil(tmp / 10.0) * 10;
        }

        if(rest != 11){
            acc -= 10;
            acc += rest;
        }
        System.out.println(acc);

    }
} import java.util.Scanner; Scanner java.util public class Main {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);

        int rest = 11;
        int acc = 0;

        for(int i=0; i<5; i++){
            int tmp = scanner.nextInt();

            if(tmp % 10 < rest && tmp % 10 != 0){
                rest = tmp % 10;
            }

            acc += Math.ceil(tmp / 10.0) * 10;
        }

        if(rest != 11){
            acc -= 10;
            acc += rest;
        }
        System.out.println(acc);

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

        int rest = 11;
        int acc = 0;

        for(int i=0; i<5; i++){
            int tmp = scanner.nextInt();

            if(tmp % 10 < rest && tmp % 10 != 0){
                rest = tmp % 10;
            }

            acc += Math.ceil(tmp / 10.0) * 10;
        }

        if(rest != 11){
            acc -= 10;
            acc += rest;
        }
        System.out.println(acc);

    } main {
        Scanner scanner = new Scanner(System.in);

        int rest = 11;
        int acc = 0;

        for(int i=0; i<5; i++){
            int tmp = scanner.nextInt();

            if(tmp % 10 < rest && tmp % 10 != 0){
                rest = tmp % 10;
            }

            acc += Math.ceil(tmp / 10.0) * 10;
        }

        if(rest != 11){
            acc -= 10;
            acc += rest;
        }
        System.out.println(acc);

    } Scanner scanner = new Scanner(System.in); scanner new Scanner(System.in) int rest = 11; rest 11 int acc = 0; acc 0 for(int i=0; i<5; i++){
            int tmp = scanner.nextInt();

            if(tmp % 10 < rest && tmp % 10 != 0){
                rest = tmp % 10;
            }

            acc += Math.ceil(tmp / 10.0) * 10;
        } int i=0; int i=0; i 0 i<5 i 5 i++ i++ i {
            int tmp = scanner.nextInt();

            if(tmp % 10 < rest && tmp % 10 != 0){
                rest = tmp % 10;
            }

            acc += Math.ceil(tmp / 10.0) * 10;
        } {
            int tmp = scanner.nextInt();

            if(tmp % 10 < rest && tmp % 10 != 0){
                rest = tmp % 10;
            }

            acc += Math.ceil(tmp / 10.0) * 10;
        } int tmp = scanner.nextInt(); tmp scanner.nextInt() scanner.nextInt scanner if(tmp % 10 < rest && tmp % 10 != 0){
                rest = tmp % 10;
            } tmp % 10 < rest && tmp % 10 != 0 tmp % 10 < rest tmp % 10 tmp 10 rest tmp % 10 != 0 tmp % 10 tmp 10 0 {
                rest = tmp % 10;
            } rest = tmp % 10 rest tmp % 10 tmp 10 acc += Math.ceil(tmp / 10.0) * 10 acc Math.ceil(tmp / 10.0) * 10 Math.ceil(tmp / 10.0) Math.ceil Math tmp / 10.0 tmp 10.0 10 if(rest != 11){
            acc -= 10;
            acc += rest;
        } rest != 11 rest 11 {
            acc -= 10;
            acc += rest;
        } acc -= 10 acc 10 acc += rest acc rest System.out.println(acc) System.out.println System.out System System.out acc String[] args args public class Main {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);

        int rest = 11;
        int acc = 0;

        for(int i=0; i<5; i++){
            int tmp = scanner.nextInt();

            if(tmp % 10 < rest && tmp % 10 != 0){
                rest = tmp % 10;
            }

            acc += Math.ceil(tmp / 10.0) * 10;
        }

        if(rest != 11){
            acc -= 10;
            acc += rest;
        }
        System.out.println(acc);

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

        int rest = 11;
        int acc = 0;

        for(int i=0; i<5; i++){
            int tmp = scanner.nextInt();

            if(tmp % 10 < rest && tmp % 10 != 0){
                rest = tmp % 10;
            }

            acc += Math.ceil(tmp / 10.0) * 10;
        }

        if(rest != 11){
            acc -= 10;
            acc += rest;
        }
        System.out.println(acc);

    }
} Main
import java.util.Scanner;

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

        int rest = 11;
        int acc = 0;

        for(int i=0; i<5; i++){
            int tmp = scanner.nextInt();

            if(tmp % 10 < rest && tmp % 10 != 0){
                rest = tmp % 10;
            }

            acc += Math.ceil(tmp / 10.0) * 10;
        }

        if(rest != 11){
            acc -= 10;
            acc += rest;
        }
        System.out.println(acc);

    }
}
