#include <bits/stdc++.h>
#define ll long long int
using namespace std;

int main(){
	int t;
	cin>>t;

	while(t--){
		int n,k;
		cin>>n>>k;
		string str;
		cin>>str;

		int i = -1 , j = n;
		while(str[++i] == '.');
		while(str[--j] == '.');
		// cout<<i<<" "<<j<<endl;

		int cnt = 0;
		if(i >= 0 && str[i] == '*'){
			cnt++;
		}

		if(j < n && j != i && str[j] == '*'){
			cnt++;
		}

		while(i < j){
			int tmp = i + k;
			if(tmp >= j){
				break;
			}
			
			int last = tmp;
			while(str[last] != '*'){
				last--;
			}

			if(last == i){
				break;
			}else{
				cnt++;
				i = last;
			}
		}
		cout<<cnt<<endl;

	}
	return 0;
}