uses crt;
const fi='vanban.txt';
fo='kq.txt';
var f1,f2:text;
st:string;
i,d,dem,k,dem1,x,y,dem2,kt,e:integer;
j:char;
a,b:array[1..100]of integer;
begin
clrscr;
assign(f1,fi); reset(f1);
assign(f2,fo); rewrite(f2);
readln(f1,st);
{---------------------cau-a------------------}
d:=length(st);
dem:=0; dem1:=0;
for i:=1 to d do
for j:='0' to '9' do
if st[i]=j then
begin
inc(dem);
val(st[i],x,y);
inc(dem1);
a[dem1]:=x;
end;
writeln(dem);
{------------cau-b------------------}
b[1]:=a[1];
dem2:=1;
for k:=1 to dem1 do
begin
kt:=0;
for e:=1 to dem2 do
if a[k]=b[e] then kt:=1;
if kt=0 then begin
inc(dem2);
b[dem2]:=a[k];
end;
end;
for k:=1 to dem2 do write(f2,b[k]:4);
close(f1);
close(f2);
readln;
end.