#include<stdio.h>
#include<malloc.h>
int main()
{
    int t;scanf("%d",&t);
    while(t--){
        int n;
        scanf("%d",&n);
        char p[1001]="\0";
        scanf("%s",p);
        char*pp=p;
        int count=0;
        while(*pp!='\0'){
            if(*pp=='.'){pp+=3;count++;}//用指针遍历
            else {pp++;}
        }
        printf("%d\n",count);
       
    }
   
    return 0 ;
}