import java.util.*;

public class Main {


    public static void main(String[] args) {

        Scanner sc = new Scanner(System.in);

//        int a = sc.nextInt();
//        int b = sc.nextInt();
//        int c = sc.nextInt();
//        int d = sc.nextInt();
//        int e = sc.nextInt();
        int a[] = new int[5];
        int ten[] = new int[5];
        int one[] = new int[5];

        int min=9;


        for (int i=0; i<5; i++){
            a[i] = sc.nextInt();
        }

        for (int i=0; i<5; i++){
            ten[i] = a[i]/10;
            if (a[i]%10!=0) ten[i] = a[i]/10+1;
        }
        for (int i=0; i<5; i++){
            one[i] = a[i]%10;
            if ((one[i]!=0)){
                min= Math.min(min, one[i]);
            }
        }
        int total=0;
        for (int i=0; i<5; i++){
            total += ten[i]*10;
        }
        if ((a[0]%10==0)&(a[1]%10==0)&(a[2]%10==0)&(a[3]%10==0)&(a[4]%10==0)) {
            System.out.println(a[0] + a[1] + a[2] + a[3] + a[4]);
//        for (int i=0; i<5; i++) System.out.println(a[i]);
        }else{
            System.out.println(total-10+min);

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


    public static void main(String[] args) {

        Scanner sc = new Scanner(System.in);

//        int a = sc.nextInt();
//        int b = sc.nextInt();
//        int c = sc.nextInt();
//        int d = sc.nextInt();
//        int e = sc.nextInt();
        int a[] = new int[5];
        int ten[] = new int[5];
        int one[] = new int[5];

        int min=9;


        for (int i=0; i<5; i++){
            a[i] = sc.nextInt();
        }

        for (int i=0; i<5; i++){
            ten[i] = a[i]/10;
            if (a[i]%10!=0) ten[i] = a[i]/10+1;
        }
        for (int i=0; i<5; i++){
            one[i] = a[i]%10;
            if ((one[i]!=0)){
                min= Math.min(min, one[i]);
            }
        }
        int total=0;
        for (int i=0; i<5; i++){
            total += ten[i]*10;
        }
        if ((a[0]%10==0)&(a[1]%10==0)&(a[2]%10==0)&(a[3]%10==0)&(a[4]%10==0)) {
            System.out.println(a[0] + a[1] + a[2] + a[3] + a[4]);
//        for (int i=0; i<5; i++) System.out.println(a[i]);
        }else{
            System.out.println(total-10+min);

        }
    }
} Main public static void main(String[] args) {

        Scanner sc = new Scanner(System.in);

//        int a = sc.nextInt();
//        int b = sc.nextInt();
//        int c = sc.nextInt();
//        int d = sc.nextInt();
//        int e = sc.nextInt();
        int a[] = new int[5];
        int ten[] = new int[5];
        int one[] = new int[5];

        int min=9;


        for (int i=0; i<5; i++){
            a[i] = sc.nextInt();
        }

        for (int i=0; i<5; i++){
            ten[i] = a[i]/10;
            if (a[i]%10!=0) ten[i] = a[i]/10+1;
        }
        for (int i=0; i<5; i++){
            one[i] = a[i]%10;
            if ((one[i]!=0)){
                min= Math.min(min, one[i]);
            }
        }
        int total=0;
        for (int i=0; i<5; i++){
            total += ten[i]*10;
        }
        if ((a[0]%10==0)&(a[1]%10==0)&(a[2]%10==0)&(a[3]%10==0)&(a[4]%10==0)) {
            System.out.println(a[0] + a[1] + a[2] + a[3] + a[4]);
//        for (int i=0; i<5; i++) System.out.println(a[i]);
        }else{
            System.out.println(total-10+min);

        }
    } main {

        Scanner sc = new Scanner(System.in);

//        int a = sc.nextInt();
//        int b = sc.nextInt();
//        int c = sc.nextInt();
//        int d = sc.nextInt();
//        int e = sc.nextInt();
        int a[] = new int[5];
        int ten[] = new int[5];
        int one[] = new int[5];

        int min=9;


        for (int i=0; i<5; i++){
            a[i] = sc.nextInt();
        }

        for (int i=0; i<5; i++){
            ten[i] = a[i]/10;
            if (a[i]%10!=0) ten[i] = a[i]/10+1;
        }
        for (int i=0; i<5; i++){
            one[i] = a[i]%10;
            if ((one[i]!=0)){
                min= Math.min(min, one[i]);
            }
        }
        int total=0;
        for (int i=0; i<5; i++){
            total += ten[i]*10;
        }
        if ((a[0]%10==0)&(a[1]%10==0)&(a[2]%10==0)&(a[3]%10==0)&(a[4]%10==0)) {
            System.out.println(a[0] + a[1] + a[2] + a[3] + a[4]);
//        for (int i=0; i<5; i++) System.out.println(a[i]);
        }else{
            System.out.println(total-10+min);

        }
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int a[] = new int[5]; a new int[5] 5 int ten[] = new int[5]; ten new int[5] 5 int one[] = new int[5]; one new int[5] 5 int min=9; min 9 for (int i=0; i<5; i++){
            a[i] = sc.nextInt();
        } int i=0; int i=0; i 0 i<5 i 5 i++ i++ i {
            a[i] = sc.nextInt();
        } {
            a[i] = sc.nextInt();
        } a[i] = sc.nextInt() a[i] a i sc.nextInt() sc.nextInt sc for (int i=0; i<5; i++){
            ten[i] = a[i]/10;
            if (a[i]%10!=0) ten[i] = a[i]/10+1;
        } int i=0; int i=0; i 0 i<5 i 5 i++ i++ i {
            ten[i] = a[i]/10;
            if (a[i]%10!=0) ten[i] = a[i]/10+1;
        } {
            ten[i] = a[i]/10;
            if (a[i]%10!=0) ten[i] = a[i]/10+1;
        } ten[i] = a[i]/10 ten[i] ten i a[i]/10 a[i] a i 10 if (a[i]%10!=0) ten[i] = a[i]/10+1; a[i]%10!=0 a[i]%10 a[i] a i 10 0 ten[i] = a[i]/10+1 ten[i] ten i a[i]/10+1 a[i]/10 a[i] a i 10 1 for (int i=0; i<5; i++){
            one[i] = a[i]%10;
            if ((one[i]!=0)){
                min= Math.min(min, one[i]);
            }
        } int i=0; int i=0; i 0 i<5 i 5 i++ i++ i {
            one[i] = a[i]%10;
            if ((one[i]!=0)){
                min= Math.min(min, one[i]);
            }
        } {
            one[i] = a[i]%10;
            if ((one[i]!=0)){
                min= Math.min(min, one[i]);
            }
        } one[i] = a[i]%10 one[i] one i a[i]%10 a[i] a i 10 if ((one[i]!=0)){
                min= Math.min(min, one[i]);
            } (one[i]!=0) one[i] one i 0 {
                min= Math.min(min, one[i]);
            } min= Math.min(min, one[i]) min Math.min(min, one[i]) Math.min Math min one[i] one i int total=0; total 0 for (int i=0; i<5; i++){
            total += ten[i]*10;
        } int i=0; int i=0; i 0 i<5 i 5 i++ i++ i {
            total += ten[i]*10;
        } {
            total += ten[i]*10;
        } total += ten[i]*10 total ten[i]*10 ten[i] ten i 10 if ((a[0]%10==0)&(a[1]%10==0)&(a[2]%10==0)&(a[3]%10==0)&(a[4]%10==0)) {
            System.out.println(a[0] + a[1] + a[2] + a[3] + a[4]);
//        for (int i=0; i<5; i++) System.out.println(a[i]);
        }else{
            System.out.println(total-10+min);

        } (a[0]%10==0)&(a[1]%10==0)&(a[2]%10==0)&(a[3]%10==0)&(a[4]%10==0) (a[3]%10==0) (a[2]%10==0) (a[0]%10==0)&(a[1]%10==0)&(a[2]%10==0)&(a[3]%10==0)&(a[4]%10==0) (a[0]%10==0) a[0]%10 a[0] a 0 10 0 (a[1]%10==0) a[1]%10 a[1] a 1 10 0 (a[2]%10==0) a[2]%10 a[2] a 2 10 0 (a[3]%10==0) a[3]%10 a[3] a 3 10 0 (a[4]%10==0) a[4]%10 a[4] a 4 10 0 {
            System.out.println(a[0] + a[1] + a[2] + a[3] + a[4]);
//        for (int i=0; i<5; i++) System.out.println(a[i]);
        } System.out.println(a[0] + a[1] + a[2] + a[3] + a[4]) System.out.println System.out System System.out a[0] + a[1] + a[2] + a[3] + a[4] a[3] a[2] a[0] + a[1] + a[2] + a[3] + a[4] a[0] a 0 a[1] a 1 a[2] a 2 a[3] a 3 a[4] a 4 {
            System.out.println(total-10+min);

        } System.out.println(total-10+min) System.out.println System.out System System.out total-10+min total-10 total 10 min String[] args args public class Main {


    public static void main(String[] args) {

        Scanner sc = new Scanner(System.in);

//        int a = sc.nextInt();
//        int b = sc.nextInt();
//        int c = sc.nextInt();
//        int d = sc.nextInt();
//        int e = sc.nextInt();
        int a[] = new int[5];
        int ten[] = new int[5];
        int one[] = new int[5];

        int min=9;


        for (int i=0; i<5; i++){
            a[i] = sc.nextInt();
        }

        for (int i=0; i<5; i++){
            ten[i] = a[i]/10;
            if (a[i]%10!=0) ten[i] = a[i]/10+1;
        }
        for (int i=0; i<5; i++){
            one[i] = a[i]%10;
            if ((one[i]!=0)){
                min= Math.min(min, one[i]);
            }
        }
        int total=0;
        for (int i=0; i<5; i++){
            total += ten[i]*10;
        }
        if ((a[0]%10==0)&(a[1]%10==0)&(a[2]%10==0)&(a[3]%10==0)&(a[4]%10==0)) {
            System.out.println(a[0] + a[1] + a[2] + a[3] + a[4]);
//        for (int i=0; i<5; i++) System.out.println(a[i]);
        }else{
            System.out.println(total-10+min);

        }
    }
} public class Main {


    public static void main(String[] args) {

        Scanner sc = new Scanner(System.in);

//        int a = sc.nextInt();
//        int b = sc.nextInt();
//        int c = sc.nextInt();
//        int d = sc.nextInt();
//        int e = sc.nextInt();
        int a[] = new int[5];
        int ten[] = new int[5];
        int one[] = new int[5];

        int min=9;


        for (int i=0; i<5; i++){
            a[i] = sc.nextInt();
        }

        for (int i=0; i<5; i++){
            ten[i] = a[i]/10;
            if (a[i]%10!=0) ten[i] = a[i]/10+1;
        }
        for (int i=0; i<5; i++){
            one[i] = a[i]%10;
            if ((one[i]!=0)){
                min= Math.min(min, one[i]);
            }
        }
        int total=0;
        for (int i=0; i<5; i++){
            total += ten[i]*10;
        }
        if ((a[0]%10==0)&(a[1]%10==0)&(a[2]%10==0)&(a[3]%10==0)&(a[4]%10==0)) {
            System.out.println(a[0] + a[1] + a[2] + a[3] + a[4]);
//        for (int i=0; i<5; i++) System.out.println(a[i]);
        }else{
            System.out.println(total-10+min);

        }
    }
} Main
import java.util.*;

public class Main {


    public static void main(String[] args) {

        Scanner sc = new Scanner(System.in);

//        int a = sc.nextInt();
//        int b = sc.nextInt();
//        int c = sc.nextInt();
//        int d = sc.nextInt();
//        int e = sc.nextInt();
        int a[] = new int[5];
        int ten[] = new int[5];
        int one[] = new int[5];

        int min=9;


        for (int i=0; i<5; i++){
            a[i] = sc.nextInt();
        }

        for (int i=0; i<5; i++){
            ten[i] = a[i]/10;
            if (a[i]%10!=0) ten[i] = a[i]/10+1;
        }
        for (int i=0; i<5; i++){
            one[i] = a[i]%10;
            if ((one[i]!=0)){
                min= Math.min(min, one[i]);
            }
        }
        int total=0;
        for (int i=0; i<5; i++){
            total += ten[i]*10;
        }
        if ((a[0]%10==0)&(a[1]%10==0)&(a[2]%10==0)&(a[3]%10==0)&(a[4]%10==0)) {
            System.out.println(a[0] + a[1] + a[2] + a[3] + a[4]);
//        for (int i=0; i<5; i++) System.out.println(a[i]);
        }else{
            System.out.println(total-10+min);

        }
    }
}

