A string of length is given. Each character of is either R or B.
You can perform the following operation:
R, change it to B. If it is B, change it to R.You want to perform given operations so that the set of positions where R appears is either empty or forms a single contiguous interval, and the set of positions where B appears is also either empty or forms a single contiguous interval.
Find the minimum number of operations required.
The input is given in the following format.
Print the minimum number of operations required.
R and B.| 4 | 38 | No additional constraints. |