program Project2;

{$APPTYPE CONSOLE}

uses
  SysUtils;

var
f,f2:text;
l,n,start,i,j,q,k:integer;
s,s1:AnsiString;
s2:array[1..100] of String;
ch:char;
begin
assign(f,'input.txt');
reset(f);
l:=0;
  readln(f,s);
  close(f);
  n:=length(s);
  start:=1;
  for i:=1 to n do
    begin
      q:=StrToInt(s[start]);
      k:=0;
      for j:=1 to n do
        begin
          if ((start+k) > n) then
            break
          else if (q = StrToInt(s[start+k])) then
            k:=k+1
          else
            begin
              s1:=s1+IntToStr(k);
              s1:=s1+IntToStr(q);
              break;
            end;
        end;
      start:=start+k;
      if (start>n) then
        break;
    end;
  s1:=s1+IntToStr(k);
  s1:=s1+IntToStr(q);
  assign(f2,'output.txt');
  rewrite(f2);
  write(f2,s1);
  close(f2);
end.
