program Project2;

uses
  SysUtils;

{$R+ W+ O+ S+}

Var f,g:text;
    x,p,k:LongInt;
    a:Char;

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

  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
             write(g,k,p);
             {write(g,p);{}
             k:=1;
           end;
      p:=x;
    end;
  write(g,k,x);
  {writeln(g,x);{}

  Close(g);
  Close(f);

end.
