#include <bits/stdc++.h>
using namespace std;
const int MAXN = 2e5 + 5;
int n, k, cnt[200], sum[200], ans;
char s[MAXN], last = ' ';
int main() {
  scanf("%d %d", &n, &k);
  scanf("%s", s);
  for (int i = 0; i < n; ++i) {
    if (last != s[i]) cnt[last] = cnt[s[i]] = 0;
    cnt[s[i]]++;
    if (cnt[s[i]] == k) cnt[s[i]] = 0, sum[s[i]]++;
    last = s[i];
  }
  for (int i = 'a'; i <= 'z'; ++i) ans = max(ans, sum[i]);
  cout << ans << endl;
}
