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

}
int h2(int &p)
{
	int mx = 0;
	if (m[p] == 'd')
	{
		p++;
		mx = max(mx, h2(p)+1);
		p++;
	}
	if (m[p] == 'u' && m[p+1] == 'd')
	{
		p++;
		mx = max(mx, h2(p));
		p++;
	}
	
	
	return mx;
}
int main()
{
	freopen("input.txt", "r", stdin);
	freopen("output.txt", "w", stdout);

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

}