import java.util.Scanner;
public class Main{
    public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);
        int a[] = new int[5];
        int b[] = new int[5];
        int c[] = new int[5];
        int min = 0;
        int minsize = 9;
        int sum = 0;

        for (int i = 0; i < 5; i++) {
            a[i] = scan.nextInt();
            b[i] = a[i] % 10;
            c[i] = a[i] / 10;
            if((b[i] <= minsize) && (b[i] != 0)){
                min = i;
                minsize = b[i];
            }
        }

        for(int x = 0; x < min ; x++){

            if(b[x] != 0 ){
                c[x] = c[x] + 1;
            }
            sum = c[x]*10 + sum;
        }

        for(int y = (min + 1) ; y < 5 ; y++){

            if(b[y] != 0 ){
                c[y] = c[y] + 1;
            }
            sum = c[y]*10 + sum;
        }

        sum = sum + c[min]*10 + b[min];
        System.out.println(sum);

    }
} import java.util.Scanner; Scanner java.util public class Main{
    public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);
        int a[] = new int[5];
        int b[] = new int[5];
        int c[] = new int[5];
        int min = 0;
        int minsize = 9;
        int sum = 0;

        for (int i = 0; i < 5; i++) {
            a[i] = scan.nextInt();
            b[i] = a[i] % 10;
            c[i] = a[i] / 10;
            if((b[i] <= minsize) && (b[i] != 0)){
                min = i;
                minsize = b[i];
            }
        }

        for(int x = 0; x < min ; x++){

            if(b[x] != 0 ){
                c[x] = c[x] + 1;
            }
            sum = c[x]*10 + sum;
        }

        for(int y = (min + 1) ; y < 5 ; y++){

            if(b[y] != 0 ){
                c[y] = c[y] + 1;
            }
            sum = c[y]*10 + sum;
        }

        sum = sum + c[min]*10 + b[min];
        System.out.println(sum);

    }
} Main public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);
        int a[] = new int[5];
        int b[] = new int[5];
        int c[] = new int[5];
        int min = 0;
        int minsize = 9;
        int sum = 0;

        for (int i = 0; i < 5; i++) {
            a[i] = scan.nextInt();
            b[i] = a[i] % 10;
            c[i] = a[i] / 10;
            if((b[i] <= minsize) && (b[i] != 0)){
                min = i;
                minsize = b[i];
            }
        }

        for(int x = 0; x < min ; x++){

            if(b[x] != 0 ){
                c[x] = c[x] + 1;
            }
            sum = c[x]*10 + sum;
        }

        for(int y = (min + 1) ; y < 5 ; y++){

            if(b[y] != 0 ){
                c[y] = c[y] + 1;
            }
            sum = c[y]*10 + sum;
        }

        sum = sum + c[min]*10 + b[min];
        System.out.println(sum);

    } main {
        Scanner scan = new Scanner(System.in);
        int a[] = new int[5];
        int b[] = new int[5];
        int c[] = new int[5];
        int min = 0;
        int minsize = 9;
        int sum = 0;

        for (int i = 0; i < 5; i++) {
            a[i] = scan.nextInt();
            b[i] = a[i] % 10;
            c[i] = a[i] / 10;
            if((b[i] <= minsize) && (b[i] != 0)){
                min = i;
                minsize = b[i];
            }
        }

        for(int x = 0; x < min ; x++){

            if(b[x] != 0 ){
                c[x] = c[x] + 1;
            }
            sum = c[x]*10 + sum;
        }

        for(int y = (min + 1) ; y < 5 ; y++){

            if(b[y] != 0 ){
                c[y] = c[y] + 1;
            }
            sum = c[y]*10 + sum;
        }

        sum = sum + c[min]*10 + b[min];
        System.out.println(sum);

    } Scanner scan = new Scanner(System.in); scan new Scanner(System.in) int a[] = new int[5]; a new int[5] 5 int b[] = new int[5]; b new int[5] 5 int c[] = new int[5]; c new int[5] 5 int min = 0; min 0 int minsize = 9; minsize 9 int sum = 0; sum 0 for (int i = 0; i < 5; i++) {
            a[i] = scan.nextInt();
            b[i] = a[i] % 10;
            c[i] = a[i] / 10;
            if((b[i] <= minsize) && (b[i] != 0)){
                min = i;
                minsize = b[i];
            }
        } int i = 0; int i = 0; i 0 i < 5 i 5 i++ i++ i {
            a[i] = scan.nextInt();
            b[i] = a[i] % 10;
            c[i] = a[i] / 10;
            if((b[i] <= minsize) && (b[i] != 0)){
                min = i;
                minsize = b[i];
            }
        } {
            a[i] = scan.nextInt();
            b[i] = a[i] % 10;
            c[i] = a[i] / 10;
            if((b[i] <= minsize) && (b[i] != 0)){
                min = i;
                minsize = b[i];
            }
        } a[i] = scan.nextInt() a[i] a i scan.nextInt() scan.nextInt scan b[i] = a[i] % 10 b[i] b i a[i] % 10 a[i] a i 10 c[i] = a[i] / 10 c[i] c i a[i] / 10 a[i] a i 10 if((b[i] <= minsize) && (b[i] != 0)){
                min = i;
                minsize = b[i];
            } (b[i] <= minsize) && (b[i] != 0) (b[i] <= minsize) b[i] b i minsize (b[i] != 0) b[i] b i 0 {
                min = i;
                minsize = b[i];
            } min = i min i minsize = b[i] minsize b[i] b i for(int x = 0; x < min ; x++){

            if(b[x] != 0 ){
                c[x] = c[x] + 1;
            }
            sum = c[x]*10 + sum;
        } int x = 0; int x = 0; x 0 x < min x min x++ x++ x {

            if(b[x] != 0 ){
                c[x] = c[x] + 1;
            }
            sum = c[x]*10 + sum;
        } {

            if(b[x] != 0 ){
                c[x] = c[x] + 1;
            }
            sum = c[x]*10 + sum;
        } if(b[x] != 0 ){
                c[x] = c[x] + 1;
            } b[x] != 0 b[x] b x 0 {
                c[x] = c[x] + 1;
            } c[x] = c[x] + 1 c[x] c x c[x] + 1 c[x] c x 1 sum = c[x]*10 + sum sum c[x]*10 + sum c[x]*10 c[x] c x 10 sum for(int y = (min + 1) ; y < 5 ; y++){

            if(b[y] != 0 ){
                c[y] = c[y] + 1;
            }
            sum = c[y]*10 + sum;
        } int y = (min + 1) ; int y = (min + 1) ; y (min + 1) min 1 y < 5 y 5 y++ y++ y {

            if(b[y] != 0 ){
                c[y] = c[y] + 1;
            }
            sum = c[y]*10 + sum;
        } {

            if(b[y] != 0 ){
                c[y] = c[y] + 1;
            }
            sum = c[y]*10 + sum;
        } if(b[y] != 0 ){
                c[y] = c[y] + 1;
            } b[y] != 0 b[y] b y 0 {
                c[y] = c[y] + 1;
            } c[y] = c[y] + 1 c[y] c y c[y] + 1 c[y] c y 1 sum = c[y]*10 + sum sum c[y]*10 + sum c[y]*10 c[y] c y 10 sum sum = sum + c[min]*10 + b[min] sum sum + c[min]*10 + b[min] sum + c[min]*10 + b[min] sum c[min]*10 c[min] c min 10 b[min] b min 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 scan = new Scanner(System.in);
        int a[] = new int[5];
        int b[] = new int[5];
        int c[] = new int[5];
        int min = 0;
        int minsize = 9;
        int sum = 0;

        for (int i = 0; i < 5; i++) {
            a[i] = scan.nextInt();
            b[i] = a[i] % 10;
            c[i] = a[i] / 10;
            if((b[i] <= minsize) && (b[i] != 0)){
                min = i;
                minsize = b[i];
            }
        }

        for(int x = 0; x < min ; x++){

            if(b[x] != 0 ){
                c[x] = c[x] + 1;
            }
            sum = c[x]*10 + sum;
        }

        for(int y = (min + 1) ; y < 5 ; y++){

            if(b[y] != 0 ){
                c[y] = c[y] + 1;
            }
            sum = c[y]*10 + sum;
        }

        sum = sum + c[min]*10 + b[min];
        System.out.println(sum);

    }
} public class Main{
    public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);
        int a[] = new int[5];
        int b[] = new int[5];
        int c[] = new int[5];
        int min = 0;
        int minsize = 9;
        int sum = 0;

        for (int i = 0; i < 5; i++) {
            a[i] = scan.nextInt();
            b[i] = a[i] % 10;
            c[i] = a[i] / 10;
            if((b[i] <= minsize) && (b[i] != 0)){
                min = i;
                minsize = b[i];
            }
        }

        for(int x = 0; x < min ; x++){

            if(b[x] != 0 ){
                c[x] = c[x] + 1;
            }
            sum = c[x]*10 + sum;
        }

        for(int y = (min + 1) ; y < 5 ; y++){

            if(b[y] != 0 ){
                c[y] = c[y] + 1;
            }
            sum = c[y]*10 + sum;
        }

        sum = sum + c[min]*10 + b[min];
        System.out.println(sum);

    }
} Main
import java.util.Scanner;
public class Main{
    public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);
        int a[] = new int[5];
        int b[] = new int[5];
        int c[] = new int[5];
        int min = 0;
        int minsize = 9;
        int sum = 0;

        for (int i = 0; i < 5; i++) {
            a[i] = scan.nextInt();
            b[i] = a[i] % 10;
            c[i] = a[i] / 10;
            if((b[i] <= minsize) && (b[i] != 0)){
                min = i;
                minsize = b[i];
            }
        }

        for(int x = 0; x < min ; x++){

            if(b[x] != 0 ){
                c[x] = c[x] + 1;
            }
            sum = c[x]*10 + sum;
        }

        for(int y = (min + 1) ; y < 5 ; y++){

            if(b[y] != 0 ){
                c[y] = c[y] + 1;
            }
            sum = c[y]*10 + sum;
        }

        sum = sum + c[min]*10 + b[min];
        System.out.println(sum);

    }
}