国产精品天干天干,亚洲毛片在线,日韩gay小鲜肉啪啪18禁,女同Gay自慰喷水

歡迎光臨散文網(wǎng) 會員登陸 & 注冊

CF 266A - Stones on the Table

2023-07-22 09:36 作者:您是打尖兒還是住店呢  | 我要投稿

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.

Examples

input

3

RRG

output

1

input

5

RRRRR

output

4

input

4

BRBG

output

0

----------------------------

找到相鄰元素相同的個(gè)數(shù)即可。

下面是代碼;


CF 266A - Stones on the Table的評論 (共 條)

分享到微博請遵守國家法律
南丹县| 长丰县| 思南县| 陇川县| 栾川县| 邵武市| 沁水县| 津南区| 长葛市| 葵青区| 邻水| 望奎县| 兰坪| 淮滨县| 开封县| 泰和县| 诸城市| 苏尼特右旗| 肃南| 璧山县| 咸宁市| 肇庆市| 新民市| SHOW| 眉山市| 钦州市| 兴文县| 开阳县| 东兰县| 乌拉特后旗| 荆门市| 苏尼特右旗| 垦利县| 交口县| 融水| 绥江县| 岐山县| 连云港市| 崇州市| 开江县| 沁阳市|