Given a string consisting of characters from ‘a’ to ‘z’ as the characters. Perfectness of a string is the maximum length substring of equal characters. Given a number k which denotes the maximum number of characters that can be changed. Find the maximum perfectness that can be generated by changing no more than k characters.
Input Format
The first line contains an integer denoting the value of K. The next line contains a string having only ‘a’ to ‘z’ as the characters.
Constraints
2 ≤ N ≤ 10^6
Output Format
A single integer denoting the maximum perfectness achievable.
Sample Input
2
aacyyyyb
Sample Output
6
2
abba
Sample Output
4
Explanation
We can swap the a’s to b using the 2 swaps and obtain the string “bbbb”. This would have all the b’s and hence the answer 4.
Alternatively, we can also swap the b’s to make “aaaa”. The final answer remains the same for both cases.