Codeforces Round 163 (Div. 2)
A
Stones on the Table
Codeforces
800
原题
←B →
翻译中…

There are $*n*$ stones 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.

翻译中…

Input

翻译中…

The first line contains integer $*n*$ $(1 ≤ *n* ≤ 50)$ — the number of stones on the table.

翻译中…

The next line contains string $*s*$, which represents the colors of the stones. We'll consider the stones in the row numbered from $1$ to $*n*$ from left to right. Then the $*i*$-th character $*s*$ equals "R", if the $*i*$-th stone is red, "G", if it's green and "B", if it's blue.

翻译中…

Output

翻译中…

Print a single integer — the answer to the problem.

翻译中…

样例

Input #1
3
RRG
Output #1
1
InputCopy OutputCopy
Input #2
5
RRRRR
Output #2
4
InputCopy OutputCopy
Input #3
4
BRBG
Output #3
0
InputCopy OutputCopy
题目信息
题号
266A
时间限制
2 s
内存限制
256 MB
标签
模拟

题面与样例版权归 Codeforces 及出题人所有;中文翻译由 AI 生成(CI 管线),如有出入请以原文为准。