#include <bits/stdc++.h>
using namespace std;
void parseArray(long long* A, long long n) {
  for (long long k = 0; k < n; k++) {
    scanf("%lld", A + k);
  }
}
const long long mod = 1000000007;
long long n, K;
char s[200020];
long long count(char c) {
  long long ans = 0;
  long long len = 0;
  for (int k = 0; k < n; k++) {
    if (s[k] == c) {
      len++;
    } else {
      len = 0;
    }
    if (len == K) {
      ans++;
      len = 0;
    }
  }
  return ans;
}
int main() {
  cin >> n >> K;
  cin >> s;
  long long ans = 0;
  for (int k = 0; k < 26; k++) {
    ans = ((ans) > (count('a' + k)) ? (ans) : (count('a' + k)));
  }
  cout << ans << endl;
  return 0;
}
