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