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

public class Main {

	Scanner in;
	PrintWriter out;

	void solve() {
		char tree[] = in.next().toCharArray();
		int lev[] = new int[tree.length];
		int count1 = 0;
		int countMax1 = 0;
		int count2 = 0;
		int countMax2 = 0;
		int left=0;
		for (int i = 0; i < tree.length; i++) {
			if (tree[i] == 'd') {
				count1++;
				count2++;
				left++;
			} else {
				count1 = 0;
				if (i+1<tree.length && tree[i+1]=='u'){
					count2-=(left+1);
				}
				left=0;
			}
			if (countMax1 < count1) {
				countMax1 = count1;
			}if (countMax2 < count2) {
				countMax2 = count2;
			}
		}
		out.println(countMax1+" "+countMax2);
	}

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

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

}
