program z2;
var i,k,x:integer; t1,t2:text; s,c:char;
begin
k:=1;
assign(t1,'input.txt');
assign(t2,'output.txt');
reset(t1); rewrite(t2);
read(t1,s);
if length(s)=0 then write(t2);
     while not eoln(t1) do
     begin read(t1,c);
     if s=c then k:=k+1 else begin write(t2,k); write(t2,s); k:=1; s:=c; end;
     end;
     write(t2,k); write(t2,s);
close(t1); close(t2);
end.
