Program Demso;

const fi='BAI4.IN4';
      fo='BAI4.OU4';
Var
     S:string;
     a:array[1..150] of string[6];
     b:array[1..150]of longint;

     d,x,k,j,i,count: longint;

     f: text;

Begin
  Assign(f,fi); reset(f);
  Readln(f,S);
  S:=' '+S+' ';

  k:=1;count:=0;
  repeat
    k:=k+1;
    if ((S[k-1]<'0') or (S[k-1]>'9')) and  ((S[k]>='0') and (S[k]<='9')) then
      begin
         inc(count);
         a[count]:='';
         j:=k;
         while S[j] in ['0'..'9']do
         begin
         j:=j+1 ;
         a[count]:=a[count]+S[j-1];
         end;
         k:=j;
         Val(a[count], b[count],x);
      end;

  until K>=length(S)-1;
  for i:=1 to count-1 do
     for j:=i+1 to count do
        if b[i]> b[j] then
        begin
         k:=b[i]; b[i]:=b[j];b[j]:=k;
        end;
  d:=1;
  for i:=2 to count do if b[i]>b[i-1] then inc(d);

  assign(f,fo); rewrite(f);
  writeln(f,d);
  writeln(f,b[1]);
  for i:=2 to count do
   if b[i]<>b[i-1] then
    writeln(f,b[i]);

  Close(f)

end.
