program Project1;

{$APPTYPE CONSOLE}

uses
  SysUtils;

var finput,foutput:textfile;
    line,line2:string;
    ans:string;
    i:integer;
    count:integer;
begin
ans:='';
assign(finput,'input.txt');
reset(finput);
readln(finput,line); //122344111

while (line<>'') do begin
  count:=0;
  i:=1;
  while (line[i]=line[1]) do begin
    inc(count);
    inc(i);
  end;
  ans:=ans+IntToStr(count)+line[1];
  line2:='';
  for i:=count+1 to Length(line) do line2:=line2+line[i];
  line:=line2;
end;

assign(foutput,'output.txt');
rewrite(foutput);
writeln(foutput,ans);

close(foutput);
end.
