program ProjectA;

uses
  SysUtils;

var
  ch: Char;
  i, d_max, d, res: Word;
  a: array [0..10000] of Word;

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

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

  a[0] := 1;

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

  d_max := 1;

  d := 0;
  while not(eof) do
    begin
      read(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:=1;
  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(d_max, ' ', res);

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

