import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.Scanner;

public class Main {
	Scanner in;
	PrintWriter out;

	String s;

	int max2 = 0;
	int ii = 0;

	void rec(int count) {
			while (ii < s.length() && s.charAt(ii) == 'd') {
				count++;
				ii++;
				rec(count);
			}
			ii++;
			max2 = Math.max(max2, count);
	}

	void solve() {
		s = in.next();
		int max = 0;
		int n = 0;
		for (int i = 0; i < s.length(); i++) {
			if (s.charAt(i) == 'd') {
				n++;
			} else {
				n--;
			}
			max = Math.max(n, max);
		}
		int count=0;
		while(ii<s.length()){
			rec(count);
			count++;
		}
		out.println(max + " " + max2);
	}

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

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