// Arup Guha
// 8/15/2014
// Solution to 2014 UCF Locals Problem: Jumping Frog

import java.util.*;
import java.io.*;

public class frog {

	public static void main(String[] args) throws Exception {

		Scanner stdin = new Scanner(new File("frog.in"));
		int numCases = stdin.nextInt();

		// Go through each case.
		for (int loop=1; loop<=numCases; loop++) {

			// Echo input.
			System.out.println("Day #"+loop);
			int n = stdin.nextInt();
			int jump = stdin.nextInt();
			String board = stdin.next();
			System.out.println(n+" "+jump);
			System.out.println(board);

			// Print Solution.
			System.out.println(solve(board, jump)+"\n");
		}
		
		stdin.close();
	}

	public static int solve(String board, int jump) {

		int cnt = 0, spot = 0;

		// Jump till end.
		while (spot < board.length()-1) {

			// Count it!
			cnt++;

			// We can make it!
			if (spot+jump+1 >= board.length()-1) return cnt;

			// Just go as far as you can, it leaves your future options open.
			int myJump = jump+1;
			while (myJump > 0 && board.charAt(spot+myJump) == 'X') myJump--;

			// No where to go :(
			if (myJump == 0) return 0;

			// Now, we jump...
			spot += myJump;
		}

		// The end.
		return cnt;
	}
}