#define loop(i,a,b) for(int i=a; i<b; ++i)
#define min(a,b) (a)<(b)?a:b;
#define max(a,b) (a)>(b)?a:b;
#include <cstdio>
#include <vector>
#include <string>
#include <algorithm>
using namespace std;
char s[10001];
vector < int > v[10000],lev[10000];
int b[10000],d1,d2,d,i,pt,used[10000];

struct leaf
{
	int l,r;
};

leaf le[10000];


void rec( int i, int d )
{
	if ( d > d2 )
		d2 = d;
	if ( le[i].l != -1 )
		rec( le[i].l, d + 1 );
	if ( le[i].r != -1 )
		rec( le[i].r, d + 1 );
}

int main()
{
	freopen("input.txt","rt",stdin);
	freopen("output.txt","wt",stdout);
	gets(s);
	b[0]=0;
	d = 0;
	pt = 0;
	while ( s[i] )
	{
		if ( s[i] == 'd' )
		{
			pt++;
			v[ b[d] ].push_back( pt );
			d++;
			if ( d > d1 )
				d1 = d;
			lev[d].push_back( pt );
			b[d]=pt;
		}
		else
		{
			--d;
		}
		i++;
	}

	loop(i,0,10000)
	{
		le[i].l = -1;
		le[i].r = -1;
	}

	loop(i,0,pt)
	{
		if ( v[i].size() != 0 )
		{
			le[i].l=v[i][0];
			used[ v[i][0] ] = 1;
		}
	}

	int q=1;
	while ( lev[q].size() )
	{
		int j=0;
		while ( j < lev[q].size() )
		{
			int last = 0;
			while ( j < lev[q].size() && used[ lev[q][j] ] )
			{
				last = lev[q][j];
				++j;
			}
			if ( j < lev[q].size() )
			{
				le[ last ].r = lev[q][j];
				used[ lev[q][j] ] = 1;
			}
		}
		++q;
	}

	rec( 0, 0 );

	printf("%d %d\n", d1 , d2 );
	return 0;
}