#include <iostream>
#include <cstdio>
#include <vector>
#include <list>
#include <algorithm>
#include <cmath>
#include <stack>
#include <map>
#include <numeric>
#include <sstream>
#include <queue>
#include <iomanip>
using namespace std;

#define REP(i,n) for(int (i)=0; (i)<(n); (i)++)
#define FOR(i,a,b) for(int (i)=(a); (i)<(b); (i)++)
#define PUSH(n,v) for(int i=0; i<(n); i++) {int j; cin >> j; v.push_back(j);}
#define ALL(v) v.begin(), v.end()
#define print(s) cout << (s) << endl

int main() {
    int n;
    cin >> n;
    int a = 0, b = 0, out = 0, ini = 0;
    int base[4] = {0};
    string s;
    while (cin >> s) {
        if (out == 3) {
            out = 0;
            ini++;
            REP(i,4) base[i] = 0;
        }
        if (s == "HIT") {
            for (int i = 2; i >= 0; i--) {
                if (base[i]) base[i+1] = 1, base[i] = 0;
            }
            base[0] = 1;
            if (base[3]) {
                if (ini % 2 + 1) a++;
                else b++;
                base[3] = 0;
            }
        }else if (s == "HOMERUN") {
            if (ini % 2 + 1) {
                REP(i,3) a += base[i];
                a++;
            }else {
                REP(i,3) b += base[i];
                b++;
            }
            REP(i,3) base[i] = 0;
        }else {
            out++;
        }
    }
    cout << a << endl << b << endl;
}