Time limit
2s
Memory limit
128 MB
Gyuwan has N balls arranged from left to right. The color of each ball is represented by one uppercase English letter.
Repeat the following process until every ball has been removed.
Determine on which operation the ball that was initially the k-th from the left is removed.
The first line contains the number of balls N and the index k of the ball whose removal time must be found.
The second line contains a string of length N. Each character is an uppercase English letter describing the color of the ball at that position.
Constraint: 1 ≤ k ≤ N ≤ 10,000,000
Print the operation number on which the ball that was initially the k-th from the left is removed.
After a group is removed, the remaining groups on its two sides may become adjacent. If they have the same color, they form one longer group, and later operations use this merged length when choosing the next group.