#OLD129. Stones on the Table
Stones on the Table
Description
There arenstones on the table in a row, each of them can be red, green or blue. Count the minimum number of stones to take from the table so that any two neighboring stones had different colors. Stones in a row are considered neighboring if there are no other stones between them.
桌子上有一排排的石头,每一块都可以是红的,绿的,蓝的。计算从桌上取下的最少数量的石头,以便任何相邻的两块石头都有不同的颜色。如果一块石头之间没有其他的石头,那么它就被认为是相邻的。
Format
Input
The first line contains integern(1 ≤n≤ 50) — the number of stones on the table.
The next line contains strings, which represents the colors of the stones. We'll consider the stones in the row numbered from 1 tonfrom left to right. Then thei-th charactersequals "R", if thei-th stone is red, "G", if it's green and "B", if it's blue.
第一行包含整数N(1 ≤N≤ 50)-在桌子上石头的数量。
下一行包含字符串S,这是石头的颜色。我们会考虑在石头的行编号从1到N的从左到右。然后,第i个字符等于“R”,如果第i个石头是红色的,“G”,如果它是绿色的,“B”,如果它是蓝色的。
Output
Print a single integer — the answer to the problem.
打印一个整数,这个问题的答案。
Samples
3
RRG
1