#include <iostream>
#include <vector>
#include <stdio.h>
#include <string>
#include <algorithm>
using namespace std;

int main()
{
		freopen("input.txt","rt",stdin);
	freopen("output.txt","wt",stdout);
	//cout.setf(ios::fixed | ios::showpoint);
	//cout.precision(2);
	string s;
	cin>>s;
	long j=0,k=0,i,a=0,b=0;
	long mass[10000];
	for(i=0;i<10000;i++) mass[i]=0;
	mass[0]=1;
	for(i=0;i<s.size();i++)
	{
		if(s[i]=='d'){k++;
		if(mass[k]==0) mass[k]+=mass[k-1];
		else mass[k]++;
		if(k>a)a=k;}
		if(s[i]=='u'){k--;}
	}
	for(i=1;i<10000;i++)
	{
		if(mass[i]==0)break;
		if(i+mass[i]-1>b)b=i+mass[i]-1;
	}
	cout<<a<<' '<<b;
	cin>>a;
	return 0;
}