#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;

	while (m[p] == 'd')
	{
		mx++;
		p++;
		mx = max(h2(p)+1, mx);
		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);

}