program petlja;
var a,b,c:string;
broj,max:int64;

function dodela(a,b,c:string):int64;
var s:word;
x:string;
begin
        x:=a+b+c;
        val(x,dodela,s);
end;

begin
        readln(a);
        readln(b);
        readln(c);
        max:=dodela(a,b,c);
        if dodela(a,c,b)>max then
                max:=dodela(a,c,b);
        if dodela(b,a,c)>max then
                max:=dodela(b,a,c);
        if dodela(b,c,a)>max then
                max:=dodela(b,c,a);
        if dodela(c,a,b)>max then
                max:=dodela(c,a,b);
        if dodela(c,b,a)>max then
                max:=dodela(c,b,a);
        writeln(max);
end.