#include <bits/stdc++.h>
using namespace std;
int n, k;
char str[(int)(2e5 + 10)];
int vis[26];
int main(void) {
  cin >> n >> k;
  memset(vis, 0, sizeof(vis));
  for (int i = 0; i < n; i++) {
    cin >> str[i];
    vis[str[i] - 'a'] = 1;
  }
  int lev1 = 0;
  int lev2 = 0;
  for (int j = 0; j < 26; j++) {
    if (!vis[j]) continue;
    int rec = 0;
    for (int i = 0; i < (n); i++) {
      if (j == (str[i] - 'a')) {
        rec++;
      }
      if (j != (str[i] - 'a')) rec = 0;
      if (rec == k) {
        lev1++;
        rec = 0;
      }
    }
    lev2 = lev2 > lev1 ? lev2 : lev1;
    lev1 = 0;
  }
  cout << lev2 << endl;
  return 0;
}
