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