#include <iostream>
#include <cstdio>
#include <cstring>
#include <string>
#include <cstdlib>

using namespace std;

char str[ 1000000 ];

int main()
{
	freopen("input.txt", "r", stdin);
	freopen("output.txt", "w", stdout);

	cin >> str;

	int N = strlen(str);

	int count = 0;
	int Max = 0;
	int A[ 10001 ];
	memset(A, 0, sizeof(A));

	for (int i = 0; i < N; i++)
	{
		if (str[ i ] == 'd')
		{
			count++;
			A[ count ]++;
			Max = max(count, Max);
		}
		else 
		{
			count--;
		}
	}

	A[ 0 ] = 1;
	
	int newMax = Max;
	for (int i = 0; i <= Max; i++)
	{
		if (A[ i ] > 1) newMax++;
	}

	cout << Max << ' ' << newMax << endl;

	fclose(stdin);
	fclose(stdout);
	return 0;
/*
dudduduudu
ddddduuuuu
*/
}