#include <bits/stdc++.h>
#pragma GCC optimize("O3")
#pragma GCC optimize("Ofast")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
using namespace std;
long long n, cnt[27], k;
string second;
int32_t main() {
  cin >> n;
  cin >> k;
  cin >> second;
  long long ans = 0, cnt = 0, d = 0;
  for (long long i = 'a'; i <= 'z'; i++) {
    d = 0;
    cnt = 0;
    for (long long j = 0; j < n; j++)
      if (second[j] == i) {
        cnt++;
        if (cnt == k) {
          d++;
          cnt = 0;
        }
      } else {
        cnt = 0;
      }
    ans = max(ans, d);
  }
  cout << ans;
  return 0;
}
