#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, k;
  cin >> n >> k;
  string s;
  cin >> s;
  int i = 0, mxcnt = 0;
  for (char ch = 'a'; ch <= 'z'; ch++) {
    int i = 0, count = 0;
    while (i < (int)s.length()) {
      int j = i;
      if (s[i] != ch) {
        i++;
        continue;
      }
      for (j; j < min(i + k, (int)s.length()); j++) {
        if (s[j] != ch) break;
      }
      if (j == i + k) count++;
      if (k == 0)
        i++;
      else
        i = j;
    }
    if (count > mxcnt) {
      mxcnt = count;
    }
  }
  cout << mxcnt << endl;
}
