var
s:string;
i,j,mt,qc,n:longint;
begin
readln(n);
for i:=1 to n do
begin
readln(s);
if (s[1]='1') and (s[2] in ['Y','E','X']) then
inc(mt)
else if (s[1]='2') and (s[2] in ['Y','E','X']) then
inc(qc);
end;
write(mt,' ',qc)
end.
/**************************************************************
Problem: 2015
User: admin
Language: Pascal
Result: Wrong Answer
****************************************************************/