#include<bits/stdc++.h>
using namespace std;
typedef unsigned long long int lld;
typedef long long int ll;
#define mod 1000000007
#define F first
#define S second
#define MAXN 1000001
#define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0)
// #include <ext/pb_ds/assoc_container.hpp>
// #include <ext/pb_ds/tree_policy.hpp>
// using namespace __gnu_pbds;
// #define ordered_set tree<pair<ll,ll>, null_type,less<pair<ll,ll>>, rb_tree_tag,tree_order_statistics_node_update>
int main()
{
  IOS;
  //sieve();
  int t = 1,tcnt = 0;
  cin>>t;
  while(t--)
  {
    ll n,k,i,ans = 0,l,lm;
    cin>>n>>k;
    string s;
    cin>>s;

    for(i = 0;i<s.length();i++){
      if(s[i]=='*')
        break;
    }
    ans++;
    l = i;
    lm = i;
    i++;
    ll d = 0;
    for(;i<s.length();i++){
      d++;
      if(s[i]=='*')
        l = i;
      if(d>=k){
        if(lm==l)
          continue;
        lm = l;
        d = i-l;
        ans++;
      }
    }

    for(i=s.length()-1;i>=0;i--){
      if(s[i]=='*')
        break;
    }
    if(i!=lm)
      ans++;
    cout<<ans<<"\n";
 
 
}}
