#include<iostream>
#include<string>
using namespace std;

int main(void){
     int atotal=0,btotal=0;
     int out=0;
     int n=0;
     bool one=false,two=false,three=false;
     string move="";
     cin >> n;
     for(int i=0;i<n;i++){
	  out = 0;
	  one=false;
	  two=false;
	  three=false;
	  do{
	       cin >> move;
	       if(move == "HIT"){
		    bool home;
		    home = three;
		    three = two;
		    two = one;
		    one = true;
		    if(home == true){
			 if(i%2 == 0){
			      atotal++;
			 }else{
			      btotal++;
			 }
		    }
		    // cout << "HIT" << endl;
		    // cout << atotal << endl;
		    // cout << btotal << endl;;
		    // cout << " " << endl;
	       }
	       if(move == "OUT"){
		    out++;
		    // cout << "OUT" << endl;
		    // cout << atotal << endl;
		    // cout << btotal << endl;
		    // cout << " " << endl;
	       }
	       if(move == "HOMERUN"){
		    if(i%2 == 0){
			 int t = 1;
			 if(one == true){
			      one = false;
			      t++;
			 }
			 if(two == true){
			      two = false;
			      t++;
			 }
			 if(three == true){
			      three = false;
			      t++;
			 }
			 atotal = atotal+t;
		    }else{
			  int t = 1;
			 if(one == true){
			      one = false;
			      t++;
			 }
			 if(two == true){
			      two = false;
			      t++;
			 }
			 if(three == true){
			      three = false;
			      t++;
			 }
			 btotal = btotal + t;
		    }
		    // cout << "z[" << endl;
		    // cout << atotal << endl;
		    // cout << btotal << endl;
		    // cout << " " << endl;
	       }
	  }while(out < 3);
     }
     cout << atotal << endl;
     cout << btotal << endl;
     return 0;
}