program ProjectB;

uses
  SysUtils;

var
  ch, ch2: char;
  i: Longword;

begin
  AssignFile(input, 'input.txt');
  reset(input);

  AssignFile(output, 'output.txt');
  rewrite(output);

  {if eof
  then
    halt(0);}

  i:=1;
  read(ch);
  while not eof do
    begin
      read(ch2);

      if ch = ch2
      then
        i:=i+1
      else
        begin
          write(i, ch);
          ch := ch2;
          i:=1;
        end;
    end;

  write(i, ch);

  CloseFile(input);
  CloseFile(output);
end.

