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

public class Main {

	Scanner in;
	PrintWriter out;

	void solve() {
		char tree[] = in.next().toCharArray();
		//**
		int count1 = 0;
		int countMax1 = 0;
		
		for (int i = 0; i < tree.length; i++) {
			if (tree[i] == 'd') {
				count1++;
			} else {
				count1 = 0;
			}
			if (countMax1 < count1) {
				countMax1 = count1;
			}
		}
		//***
		int table[][] = new int[tree.length+1][tree.length+1];
		table[1][1] = 1;
		int i = 0;
		int x = 1;
		int y = 1;
		while (i < tree.length) {
			if (tree[i] == 'd') {
				y++;
				while (table[x][y] == 1) {
					x++;
				}
				table[x][y] = 1;
			}
			if (tree[i] == 'u') {
				while (table[x][y] == 1) {
					x--;
				}
				x++;
				y--;
			}
			i++;
		}
		int count2=0;
		int countMax2=0;
		for(int k=1;k<=tree.length;k++){
			for(int p=1;p<=tree.length;p++){
				if(table[k][p]==1){
					count2=k+p;
				}
				if(countMax2<count2){
					countMax2=count2;
				}
//				out.print(table[p][k]+" ");
			}
//			out.println();
		}
		out.println(countMax1+" "+(countMax2-2));
	}

	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();
	}

}
