program Nadovezivanje;
var A,B,C,I:integer;
x:array[1..6] of integer;
max:integer;
s1,s2,s3:string;
code:integer;
begin
readln(A,B,C);
str(A,s1);
str(B,s2);
str(C,s3);
val(s1+s2+s3,x[1],code);
val(s1+s3+s2,x[2],code);
val(s2+s1+s3,x[3],code);
val(s2+s3+s1,x[4],code);
val(s3+s2+s1,x[5],code);
val(s3+s1+s2,x[6],code);
max:=x[1];
I:=0;
for I:=2 to 6 do 
if (x[I]>max) then
max:=x[I];
writeln(max);
end.