AT_abc421_c [ABC421C] Alternated

Description

You are given a string $ S $ of length $ 2N $ . $ S $ contains exactly $ N $ occurrences of `A` and $ N $ occurrences of `B`. Find the minimum number of operations (possibly zero) needed to make $ S $ have no adjacent identical characters, where an operation consists of swapping two adjacent characters in $ S $ .

Input Format

The input is given from Standard Input in the following format: > $ N $ $ S $

Output Format

Print the answer.

Explanation/Hint

### Sample Explanation 1 By performing operations as follows, you can achieve a state with no adjacent identical characters in two operations: - Swap the $ 2 $ nd and $ 3 $ rd characters. $ S $ becomes `ABABBA`. - Swap the $ 5 $ th and $ 6 $ th characters. $ S $ becomes `ABABAB`. ### Sample Explanation 2 Note that you can only swap adjacent characters. ### Constraints - $ 1\leq N \leq 5\times 10^5 $ - $ N $ is an integer. - $ S $ is a string of length $ 2N $ consisting of $ N $ occurrences of `A` and $ N $ occurrences of `B`.