program Project2;

uses
  SysUtils;

Var f,g:text;
    x,p,k:Word;
    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);
             k:=1;
           end;
      p:=x;
    end;
  write(g,k,x);

  Close(g);
  Close(f);

end.
