#include <bits/stdc++.h>

using namespace std;

#define FOR(i,k,n) for(int i = (k); i < (n); i++)
#define REP(i,n) FOR(i,0,n)
#define INF 114514810
#define ELEM(array) (sizeof (array)/sizeof *(array))
#define MAX_N 100
typedef long long ll;

int n;
int count_HIT=0, count_OUT=0;
int Point[2] = {0,0};
int i=0;
string S;



int main()
{
	cin >> n;
	REP(i, n)
	{
		while (count_OUT == 3)
		{
			cin >> S;
			if (S == "HIT"){
				count_HIT++;
				if (count_HIT == 4)
				{
					Point[i]++;
					count_HIT = 0;
				}
			}
			else if (S == "HOMERUN")
			{
				Point[i] = count_HIT + 1;
				count_HIT = 0;
			}
			else count_OUT++;
		}
		count_OUT = 0; count_HIT = 0;
		i ^= 1;
		n++;
	}

	cout << Point[0] << endl
		<< Point[1] << endl;

	return 0;
}