#include <bits/stdc++.h>
using namespace std;
int main()
{
//write your code here
int t;
cin>>t;
while (t--){
int n;
cin>>n;
char arr[n];
int count=0;
for(int i=0;i<n;i++){
cin>>arr[i];
}
for(int i=0;i<n;i++){
if(arr[i]=='x'){
count++;
}
}
cout<<count<<endl;
}
return 0;
}
I2luY2x1ZGUgPGJpdHMvc3RkYysrLmg+CiAgdXNpbmcgbmFtZXNwYWNlIHN0ZDsKICAKICBpbnQgbWFpbigpCiAgewogICAgLy93cml0ZSB5b3VyIGNvZGUgaGVyZQogICAgaW50IHQ7CiAgICBjaW4+PnQ7CiAgICB3aGlsZSAodC0tKXsKICAgICAgaW50IG47CiAgICAgIGNpbj4+bjsKICAgICAgY2hhciBhcnJbbl07CiAgICAgIGludCBjb3VudD0wOwogICAgICBmb3IoaW50IGk9MDtpPG47aSsrKXsKICAgICAgICBjaW4+PmFycltpXTsKICAgICAgfQogICAgICBmb3IoaW50IGk9MDtpPG47aSsrKXsKICAgICAgICBpZihhcnJbaV09PSd4Jyl7CiAgICAgICAgICBjb3VudCsrOwogICAgICAgIH0KICAgICAgfQogICAgICBjb3V0PDxjb3VudDw8ZW5kbDsKICAgIH0KICAgIAogICAgcmV0dXJuIDA7CiAgfQ==