#include <stdio.h>

//#define mmax(a,b) (a>b)?a:b;

int mmax(int a, int b)
{
	return (a>b)?a:b;
}

char c[10001];
int n;
int a, b;

int R(int s, int e)
{
	if( s == e )
	{
		return 0;
	}
	else if( e - s == 1 )
	{
		return 0;
	}
	else if( e - s == 2 )
	{
		return 1;
	}
	else if( e - s == 3 )
	{
		return 1;
	}
	int c1 = 0;
	for(int i = s; i < e; i++)
	{
		if( c[i] == 'd' )
		{
			c1++;
		}
		else if( c[i] == 'u' )
		{
			c1--;
			if( c1 == 0 )
			{
				if( i + 1 == e )
				{
					return 1 + R(s + 1, i);
				}
				return mmax(R(s, i + 1), 1 + R(i + 1, e));
			}
		}
	}
	return 0;
}

int main()
{
	freopen("input.txt", "rt", stdin);
	//freopen("output.txt", "wt", stdout);
	while( scanf("%c", &c[n++]) == 1 );
	a = 0;
	int c1 = 0;
	for(int i = 0; i < n; i++)
	{
		if( c[i] == 'd' )
		{
			c1++;
		}
		else if( c[i] == 'u' )
		{
			c1--;
		}
		if( c1 > a )
		{
			a = c1;
		}
	}
	b = R(0, n);
	printf("%d %d\n", a, b);
	return 0;
}