You are given a string of length , consisting only of the characters R, G, B.
The string is considered cyclic: after the character s_n, there is s_1, meaning the indices are counted modulo (for example, s_{n+1}=s_1, s_{n+2}=s_2).
For each position , consider the triplet of consecutive characters (s_i,\; s_{i+1},\; s_{i+2}), where all indices are taken modulo .
We call the triplet good if all three characters in it are pairwise different (i.e., it is R, G, B in any order).
In one operation, you can choose any position and change s_i to any of the three characters R, G, B. The cost of the operation is .
Find the minimum number of operations required so that for every i=1,2,\dots,n the triplet (s_i, s_{i+1}, s_{i+2}) is good.
The first line contains the number (1 \le n \le 10^6) — the length of the string .
The second line contains the string consisting of the characters , , .
You need to output a single number — the minimum number of operations required for all triplets (s_i, s_{i+1}, s_{i+2}) for i=1,2,\dots,n to become good.
If this is impossible, output .
Example 1
Example 2
For the second test case, the answer is achieved by transforming the string into the string .
Subtask ( points): (n \le 15)
Subtask ( points): (The string consists of only different characters)
Subtask ( points): (n \le 5000)
Subtask ( points): Without additional constraints