program ProjectA;

uses
  SysUtils;

var
  ch: Char;
  d, d_max, i, res: Word;
  a: array [1..10001] of Word;
  fin, fout: TextFile;

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

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

  for i:=1 to 10001 do
    a[i] := 0;

  a[1] := 1;

  d_max := 0;
  d := 1;
  while not(eof(fin)) do
    begin
      read(fin, ch);

      if ch = 'd'
      then
        begin
          d := d + 1;

          if d_max < d
          then
            d_max := d;
        end
      else
        begin
          a[d] := a[d] + 1;

          d := d - 1;
        end;
    end;

  res := 0;

  i:=2;
  while a[i]<>0 do
    begin
      if a[i-1] = 1
      then
        res := res + a[i]
      else
        res := res + a[i] - 1;

      i:=i+1;
    end;

  write(fout, d_max-1, ' ', res);
  //write(fout, '2 4');

  CloseFile(fin);
  CloseFile(fout);
end.

