五月天青色头像情侣网名,国产亚洲av片在线观看18女人,黑人巨茎大战俄罗斯美女,扒下她的小内裤打屁股

歡迎光臨散文網(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的評論 (共 條)

分享到微博請遵守國家法律
临江市| 洛阳市| 黄大仙区| 延安市| 广昌县| 新兴县| 合水县| 疏附县| 定远县| 和平县| 贵溪市| 庐江县| 嘉定区| 兴安盟| 长宁区| 深泽县| 迭部县| 大悟县| 五大连池市| 东莞市| 新昌县| 时尚| 黄陵县| 鄂尔多斯市| 南平市| 古交市| 大荔县| 靖州| 教育| 镇坪县| 云林县| 宁陕县| 新营市| 东丽区| 贵港市| 长子县| 兴宁市| 静海县| 乌鲁木齐市| 诏安县| 赤水市|