program Project2;

{$APPTYPE CONSOLE}

uses
  SysUtils;

var
f,f2:text;
i,j,k,start1:integer;
s,sss:AnsiString;
begin
assign(f,'input.txt');
reset(f);
  readln(f,s);
  close(f);
  start1:=1;
  for i:=start1 to length(s) do
    begin
      k:=0;
      for j:=start1 to length(s) do
        begin
          if (s[start1] = s[j]) then
            k:=k+1
          else
              break;
        end;
      sss:=sss+IntToStr(k);
      sss:=sss+s[start1];
      if (j >= length(s)) then
        break;
      start1:=j;
    end;
  assign(f2,'output.txt');
  rewrite(f2);
  write(f2,sss);
  close(f2);
end.
