#include <bits/stdc++.h>
#pragma optimization_level 3
#pragma GCC optimize("Ofast,no-stack-protector")
#pragma GCC target( \
    "sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,avx2,tune=native")
#pragma GCC optimize("unroll-loops")
#pragma GCC optimize("fast-math")
using namespace std;
signed main() {
  cin.tie(0);
  cout.tie(0);
  cin.sync_with_stdio(0);
  cout.sync_with_stdio(0);
  int n, k;
  cin >> n >> k;
  string s;
  cin >> s;
  int ans = 0;
  for (int j = 0; j < 26; ++j) {
    char c = j + 'a';
    int pp = 0;
    for (int i = 0; i < n; ++i) {
      if (s[i] == c) {
        int id = i;
        int kek = 0;
        while (s[id] == c && kek != k) {
          ++kek;
          ++id;
        }
        if (kek == k) {
          ++pp;
        }
        i = id - 1;
      }
    }
    ans = max(pp, ans);
  }
  cout << ans << endl;
  return 0;
}
