Biologists discovered an unusual DNA molecule they had never seen before. The molecule can be represented as a length-N string consisting only of the characters A and B. After several mutations, it can become a molecule whose characters are all A.
The researchers found that only two types of mutation are possible.
A becomes B, and B becomes A.)K, then change all of the first K characters to the other character.Given the DNA molecule, find the minimum number of mutations needed to make every character A.
The first line contains the length N of the molecule. (1 ≤ N ≤ 1,000,000)
The second line contains the length-N string consisting only of A and B.
Print the minimum number of mutations needed to make every character A.