Pair Count
View as PDFWe define the value of a string of length
as the number of pairs
such
that
,
is
m, and is
u.
Given a string of length
and an integer
, find the maximum possible value of
such that there exists a contiguous substring of
with length
and value at
most
.
Input
The first line contains two integers and
.
The second line contains the string of length
.
Output
Print a single integer representing the maximum possible length .
Constraints
consists only of lowercase English letters.
Example 1
Input
10 3
mumumumumu
Output
6
Explanation
The longest substring of that has the value
is
.
Example 2
Input
8 1
monashuni
Output
8
Comments