var a,b:string;
 i,s:integer;
  f:boolean; input,output:text;
begin
assign (input,'D:\Program\input.txt');reset(input);
assign (output,'D:\Program\output.txt');rewrite(output);
read(input,a);
i:=1;
while i<>(length(a)+1) do
begin
s:=1;
f:=true;
while f=true do
if a[i]=a[i+1] then begin s:=s+1;i:=i+1; end else f:=false;
write(output,s,a[i]);
i:=i+1;
end;
  close(input);
  close(output);

  { TODO -oUser -cConsole Main : Insert code here }
end.
