Jonathan is given a string
- Remove a substring of length up to
(inclusive) from the string. - Remove up to
(inclusive) characters from the remaining string.
Let a
's in the resultant string, b
's, etc. Jonathan's goal is to minimize
Python users are recommended to use PyPy over CPython. There is a significant performance increase.
Input Specification
The first line will contain the string
The second line will contain two integers,
Output Specification
Output the minimum possible value of
Constraints
Subtask 1 [30%]
Subtask 2 [70%]
No additional constraints.
Sample Input 1
Copy
abcdefghijkllllll
0 5
Sample Output 1
Copy
12
Sample Input 2
Copy
rimuruclasher
3 2
Sample Output 2
Copy
8
Comments