program Project2;

{$APPTYPE CONSOLE}

uses
  SysUtils;

var f:textfile;i,col:integer;line,str,c:string;
begin
c:='';
col:=1;
AssignFile(f,'input.txt');
reset(f);
Readln(f,line);
CloseFile(f);
 c:=line[1];
 str:='';
for i:=2 to length(line) do
begin
 if c=line[i] then inc(col)
 else
 begin
  str:=str+inttostr(col)+c;
  c:=line[i];
  col:=1;
 end;
end;
str:=str+inttostr(col)+c;
AssignFile(f,'output.txt');
Rewrite(f);
Writeln(f,str);
CloseFile(f);
end.