#include <cstdio>
#include <iostream>
#include <cmath>
using namespace std;
char m[1000000];
int h1(int &p)
{
	int mx = 0;
	while (m[p] == 'd')
	{
		p++;
		mx = max(h1(p)+1, mx);
		p++;
	}
	return mx;

}
int maxK = 0;
int h2(int &p, int k)
{
	if (k > maxK) maxK = k;
	if (m[p] == 'd')
	{
		p++;
		h2(p, k+1);
		p++;
		
	}
	if (m[p] == 'u' && m[p+1] == 'd')
	{
		p+=2;
//		cout << k << "R\n";
		h2(p, k+1);
		//p++;		
	}
	
	
	return 0;
}
int main()
{
	freopen("input.txt", "r", stdin);
	freopen("output.txt", "w", stdout);

	cin >> m;
	int p = 0;
	cout << h1(p);
	p = 0;
	h2(p,0);
	cout << " " << maxK;

}