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

public class Main {

	Scanner in;
	PrintWriter out;
	
	void solve() {
		char tree[] = in.next().toCharArray();
		char tree2[] = new char[tree.length];
		int count1 = 0;
		int countMax1 = 0;
		
		int j=0;
		
		for (int i = 0; i < tree.length; i++) {
			if (tree[i] == 'd') {
				count1++;
			} else {
				count1 = 0;
			}
			if (countMax1 < count1) {
				countMax1 = count1;
			}
		}
		
		int count=0;
		for (int i = 0; i < tree.length; i++) {
			if (tree[i] == 'd') {
				tree2[j]='d';
				j++;
				count=0;
			} else {
				if (i<tree.length-1 && tree[i+1]=='d'){
					tree2[j]='d';
					j++;
					i++;
					count++;
				}else{	
					for(int p=1;p<=count;p++){
						tree2[j]='u';
						j++;
					}
					tree2[j]='u';
					j++;
					count=0;
				}
			}
		}
		int count2 = 0;
		int countMax2 = 0;
		for(int i=0;i<tree2.length;i++){
			if(tree2[i]=='d'){
				count2++;
			}else{
				count2=0;
			}
			if (countMax2<count2){
				countMax2=count2;
			}
		}
//		out.println();
//		for(int i=0;i<tree2.length;i++){
//			out.print(tree2[i]);
//		}
		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();
	}

}
