program Project2;

{$APPTYPE CONSOLE}

uses
  SysUtils;

var a,l,y,u:string;
  c:array[1..1001] of integer;
  i,code,k:integer;
begin
  assign(input,'input.txt');
  reset(input);
  assign(output,'output.txt');
  rewrite(output);
  readln(a);
  k:=1;
  val(a[1],c[1],code);
  for i:=2 to length(a) do
  begin
    val(a[i],c[i],code);
    if (c[i]=c[i-1]) then k:=k+1 else begin
    str(k,y);
    str(c[i-1],u);
    l:=l+y+u;
    k:=1; end;
    if i=length(a) then begin
    str(k,y);
    str(c[i-1],u);
    l:=l+y+u; end;
  end;
  if length(a)=1 then l:='1'+a;
  writeln(l);
  readln;
end.
 