#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, k;
  cin >> n >> k;
  string str;
  cin >> str;
  int t = 0;
  for (int i = 0; i < 26; i++) {
    char ch = i + 97;
    int p = 0, l = 0;
    for (int i = 0; i < n; i++) {
      if (str[i] == ch) {
        int flag = 0;
        for (int j = i; j < i + k; j++) {
          if (str[j] != ch) {
            i = j - 1;
            flag = 1;
            break;
          }
        }
        if (flag == 0) {
          i = i + k - 1;
          p++;
        }
      }
    }
    if (p > t) t = p;
  }
  cout << t;
}
