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

int main(){

    #ifndef ONLINE_JUDGE
    freopen("input.txt", "r" ,stdin);
    freopen("output.txt", "w" ,stdout);
    #endif
    
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);

    ll t=1;
    cin>>t;
    while(t--){
        int n,k;
        cin>>n>>k;

        string s;
        cin>>s;
        vector<int>v,p;

        for(int i=0;i<n;i++){
            if(s[i]=='*'){
                v.push_back(i);
            }
        }
        int sz=v.size();

        int ans1=1,last=v[0];
        for(int i=1;i<sz-1;i++){
            if((v[i+1]-last)>k){
                ans1++;
                last=v[i];
            }
        }
        if(last!=v[sz-1]){
            ans1++;
        }

        int ans2=1;
        last=v[sz-1];
        for(int i=sz-2;i>0;i--){
            if((last-v[i-1])>k){
                ans2++;
                last=v[i];
            }
        }
        if(last!=v[0]){
            ans2++;
        }
        // cout<<ans1<<' '<<ans2<<'\n';
        cout<<min(ans1,ans2)<<'\n';
    }
    
    return 0;
}