#include <iostream>
using namespace std;
string str;
int numa,numb;
void init()
{
numa=0;
numb=0;
}
int main()
{
int n;
while(cin>>n)
{
init();
for(int i=0;i<n;i++)
{
cin>>str;
if(str[0]=='1'&&(str[1]=='Y'||str[1]=='E'||str[1]=='X'))
{
numa++;
}
if(str[0]=='2'&&(str[1]=='Y'||str[1]=='E'||str[1]=='X'))
{
numb++;
}
}
cout<<numa<<" "<<numb<<endl;
}
return 0;
}
/**************************************************************
Problem: 2015
User: admin
Language: C++
Result: Accepted
Time:9 ms
Memory:2076 kb
****************************************************************/