import java.util.*;
import java.io.*;

class Main {

   Scanner in;
   PrintWriter out;

   final String INPUT_FILE_NAME = "input.txt";
   final String OUTPUT_FILE_NAME = "output.txt";

   void solve() {

      char inp[] = in.nextLine().toCharArray();

      int depth = 0;
      int maxDepth = 0;

      for (int i = 0; i < inp.length; i++) {
         if (inp[i] == 'd') {
            depth++;
            maxDepth = Math.max(maxDepth, depth);
         } else {
            depth--;
         }
      }
      out.print(maxDepth + " ");
      depth = 0;
      char mask[] = { 'd', 'u', 'd' };
      int depth2 = 0;
      for (int i = 0; i < inp.length; i++) {
         int counter = 0;
         for (int j = 0; j < mask.length; j++) {
            if (j + i < inp.length && inp[i + j] == mask[j]) {
               counter++;
            }
         }
         if (counter == 3) {
            depth2++;
         }
      }
      if (depth2 == 1) {
         depth2 = 0;
      }
      out.print(maxDepth + depth2);

   }

   void run() {
      try {
         in = new Scanner(new FileReader(INPUT_FILE_NAME));
         out = new PrintWriter(OUTPUT_FILE_NAME);
      } catch (IOException e) {
         throw new Error(e);
      }
      try {
         solve();
      } finally {
         out.close();
      }
   }

   public static void main(String[] args) {
      new Main().run();

   }
}

// class Scanner {
// StreamTokenizer in;
//
// Scanner(Reader r) {
// in = new StreamTokenizer(new BufferedReader(r));
// in.resetSyntax();
// in.whitespaceChars(0, 32);
// in.wordChars(33, 255);
// }
//
// String next() {
// try {
// in.nextToken();
// return in.sval;
// } catch (Exception e) {
// throw new Error();
// }
// }
//
// double nextDouble() {
// return Double.parseDouble(next());
// }
//
// int nextInt() {
// return Integer.parseInt(next());
// }
//
// long nextLong() {
// return Long.parseLong(next());
// }
// }
