import std.stdio, std.array, std.string, std.conv, std.algorithm;
import std.typecons, std.range, std.random, std.math, std.container;
import std.numeric, std.bigint, core.bitop, core.stdc.string;

void main() {
    auto s = readln.split.map!(to!int);
    auto N = s[0];
    auto K = s[1];
    auto S = readln.chomp;
    int ans = 0;

    for (char c = 'a'; c <= 'z'; ++c) {
        int tmp = 0;
        int v = 0;
        foreach (i; 0..N) {
            if (S[i] == c) {
                tmp += 1;
                if (tmp == K) {
                    v += 1;
                    tmp = 0;
                }
            } else {
                tmp = 0;
            }
        }
        ans = max(ans, v);
    }

    ans.writeln;
}
