program z2;
var i,k,x:integer; t1,t2:text; s:string;
begin
k:=1;
assign(t1,'input.txt');
assign(t2,'output.txt');
reset(t1); rewrite(t2);
if length(s)=1 then begin write(t2,k); write(t2,s[i]) end
else
    begin
    readln(t1,s);
    for i:=1 to length(s) do
    if s[i]=s[i+1] then k:=k+1
       else begin write(t2,k); write(t2,s[i]); k:=1; end;
    end;
close(t1); close(t2);
end.
