#include <bits/stdc++.h>
#define ll long long int
#define ld long double
using namespace std;
void mainSolve()
{
int n;
cin >> n;
int start(0), ltime(0);
for (int i = 0; i < n; i++)
{
string s;
cin >> s;
if (s[0] == 'S')
++start;
else
++ltime;
}
cout << start << " " << ltime << endl;
}
int main()
{
#ifndef ONLINE_JUDGE
freopen("input.txt", "r", stdin);
freopen("output.txt", "w", stdout);
#endif
int t;
cin >> t;
while (t--)
{
mainSolve();
}
return 0;
}