#include<bits/stdc++.h>
using namespace std;


#define int long long
#define ll long long
#define pb push_back

#define loop(i, a, b) for(int i = (a); i < (b); i++)
#define loopb(i, a, b) for(int i = (a); i > (b); --i)

typedef pair <int,int> ii;
typedef vector <int> vi;
typedef vector <ii> vii;
typedef vector <ll> vl;

const int mod = 1e9+7;
const ll inf = 2e18+5;



void solve(){
    int n,k;
    cin>>n>>k;
    string s;
    cin>>s;
    int last=-1,lasttake=-1;
    int ans=0;
    int flag=0;
    int cnt=0;
    loop(i,0,n){
        if(s[i]=='*'){
            cnt++;
            if(last==-1){
                ans++;
                last=i;
                lasttake=i;
                if(i==n-1) flag=1;
            }
            else{
                if(i-lasttake>k){
                    i=last;
                    lasttake=i;
                    ans++;
                    if(i==n-1) flag=1;
                }
                else{
                    last=i;
                }
            }
        }
    }
    if(flag==0) ans++;
    if(cnt==1) ans=1;
    cout<<ans;
    cout<<"\n";
}













signed main(){
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    #ifndef ONLINE_JUDGE
            freopen("fin.txt", "r", stdin);
            freopen("fout.txt", "w", stdout);
    #endif   
    int cases=1;
    cin>>cases;
    
    
    for(int iter=0; iter<cases; iter++){      
        solve();
    }
    return 0;
}