program Project1;

{$APPTYPE CONSOLE}

uses
  SysUtils;

function extract(line:string;ind:integer):integer;
var i:integer; c:char; counter:integer;
begin
counter:=0;
c:=line[ind];
i:=ind;
while (line[i]=c) do begin
  inc(counter);
  inc(i);
end;
Result:=counter;
end;

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:=extract(line,1);
  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.
