#include<stdio.h>
#include<string.h>
int main(void)
{
	int HIT=0,HOMERUN=0,OUT=0,POINT[2]={0},a,b,c=0;
	char EVENT[100][8];	
	for(;;)
	{
		scanf("%d",&a);
		for(b=0;;b++)
		{
			scanf("%s",EVENT[b]);
			if(strcmp(EVENT[b],"OUT")==0)
				OUT++;
			if(strcmp(EVENT[b],"HIT")==0)
			{
				HIT++;
				if(HIT==4)
				{
					POINT[c]++;
					HIT--;
				}
			}
			if(strcmp(EVENT[b],"HOMERUN")==0)
			{
				POINT[c]+=HIT+1;
				HIT=0;
			}
			if(OUT==3)
			{
				OUT=0;
				HIT=0;
				c++;
			}
			if(c==a)
			{
				printf("%d\n%d\n",POINT[0],POINT[1]);
				return 0;
			}
		}
	}
}