#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, k;
  string s;
  cin >> n >> k >> s;
  int ans = 0;
  for (int i = 0; i < 26; i++) {
    int tmp = 0, tot = 0;
    for (int j = 0; j < n; j++) {
      if (s[j] == i + 'a')
        tot++;
      else
        tot = 0;
      if (tot == k) {
        tmp++;
        tot = 0;
      }
    }
    ans = max(ans, tmp);
  }
  cout << ans << endl;
  return 0;
}
