program Project2;

uses
  SysUtils;

{$R+ W+ O+ S+}

Var f,g:text;
    x,p,k,u:LongInt;
    a:Char;
    m:array[1..2000] of Integer;

begin
  assign(f,'input.txt');
  ReSet(f);

  u:=0;
  k:=1;
  read(f,a);
  p:=ord(a)-ord('0');
  while not(eof(f)) do
    begin
      read(f,a);
      x:=ord(a)-ord('0');
      if (x=p)
      then Inc(k)
      else begin
             Inc(U); m[U]:=k;
             Inc(U); m[U]:=p;
             {write(g,k,p);{}
             {write(g,p);{}
             k:=1;
           end;
      p:=x;
    end;
  Inc(U); m[U]:=k;
  Inc(U); m[U]:=x;
  {write(g,k,x);{}
  {writeln(g,x);{}

  Close(f);
  assign(f,'output.txt');
  ReWrite(f);
  for k:=1 to U do
    write(f,m[k]);
  Close(f);

end.
