import java.util.*;
public class Main{
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int t = Integer.valueOf(sc.nextLine());
        for(int p = 0; p < t; ++p){
            int n = Integer.valueOf(sc.nextLine());
            String s = sc.nextLine();
            int r = 0;
            for(int i = 0; i < n; ++i){
                if(s.charAt(i) == '.'){//有要照的区域就+3,易证子问题最优
                    r++;
                    i += 2;
                }
            }
            System.out.println(r);
        }
    }
}