program zadachaA;
 var mas: array[1..10000] of char;
     sim: char;
     i,k,h1,max,pm,h2,shd,shu: integer;
begin
 assign(input,'input.txt');
 assign(output,'output.txt');
 reset(input); rewrite(output);
 k:=1;
  repeat
   read(sim);
   case sim of
   'd': mas[k]:='d';
   'u': mas[k]:='u';
   end;
   inc(k);
  until eof;
 max:=1; dec(k); pm:=1;
 for i:=1 to k-1 do
  begin
   if (mas[i]=mas[i+1])and(mas[i]='u') then begin
                                             inc(pm);
                                             if pm>max then max:=pm;
                                            end
   else pm:=1;
  end;
 h1:=max; write(h1,' ');
 h2:=0; shu:=0; shd:=0;
 for i:=1 to k-1 do
  if not(mas[i]=mas[i+1]) then if mas[i]='u' then inc(shu)
                              else inc(shd);
 if shd>shu then h2:=shu
 else h2:=shd;
 if (shd=0)or(shu=0)then h2:=h1;
 write(h2);
 close(input); close(output);
end.