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

Difficulty: interview

Starter code:

Solutions:
n = int(input())
s = input()
r = 0
for i in range(1, n):
    if s[i] == s[i - 1]:
        r += 1
print(r)

s = input()
s = input()

res = 0
for i in range(len(s) - 1):
	if s[i] != s[i + 1]:
		res += 1
print(len(s) - res - 1)


n = int( input().split()[0] )
s = input().split()[0]
c = 'A'
answer = 0
for i in range( 0, len( s ) ):
	if s[i] != c:
		answer += 1
	c = s[i]
print( n - answer )

n = int(input())
s = input()
r = 0
for i in range(1, n):
    if s[i] == s[i - 1]:
        r += 1
print(r)

n = int(input())
s = input()
count = 0
i = 1
while(i < n):
    if(s[i] == s[i-1]):
        count += 1
    i += 1
print(count)


n = int(input())
s = input()
ans = 0
i = 0
while i < len(s):
	c = s[i]
	j = i + 1
	while j < len(s) and s[i] == s[j]:
		ans += 1
		j += 1
	i = j
print(ans)


n = int(input())
s = input()
k = 0
for i in range(n-1):
    if s[i] == s[i+1]:
        k += 1
print(k)

import sys
inp = sys.stdin
n = int(inp.readline())
s = inp.readline()
cnt = 1
for i in range(1, n):
  if s[i] != s[i - 1]:
    cnt += 1
print(n - cnt)  

n=int(input())
s=input()
c=" "
tmp=0
for i in range(len(s)):
	if s[i]!=c:
		tmp+=1
		c=s[i]
print(len(s)-tmp)

n=int(input())
s=input()
ans=0
while("RR" in s or "BB" in s or "GG" in s):
    if("RR" in s):
        ans+=s.count("RR")
        s=s.replace("RR","R")
    if("BB" in s):
        ans+=s.count("BB")
        s=s.replace("BB","B")
    if("GG" in s):
        ans+=s.count("GG")
        s=s.replace("GG","G")
print(ans)


s=""
n=int(input())
s=input()
count=0
for i in range(n-1):
    if s[i]==s[i+1]:
        count=count+1
print(count)

n = int(input())
s=input()
count=0
j=0
i=1
while i<n:
    if s[i]==s[j]:
        count+=1
    else:
        j=i
    i+=1
print(count)

r=input;r();c=r();print(sum(p==n for p,n in zip(c[1:],c)))

n=int(input())
q=input()
c=list(q)
r=0
g=0
b=0
t=0
for i in range(0,len(c)) :
    if c[i]=="R" :
        r=r+1
        g=0
        b=0
    elif c[i]=="G" :
        r=0
        g=g+1
        b=0
    else :
        r=0
        g=0
        b=b+1
    if r>1 :
        t=t+1
        r=1
    if g>1 :
        t=t+1
        g=1
    if b>1 :
        t=t+1
        b=1
print(t)


n = int(input())
S = input()

ans = 0
for i in range(1, len(S)):
	if S[i] == S[i-1]:
		ans += 1
		
print(ans)

n, s = int(input()), input()
print(sum([a == b for a, b in zip(s[1:], s)]))

# your code goes here
n = int(input())
str = input()

S = 0
prev = str[0]
LEN = len(str)
i = 1
if LEN > 1:
    while i < n:
        if str[i] == prev:
            S+=1
        else:
            prev = str[i]
        i +=1 
print (S)

import sys

a = int (sys.stdin.readline().strip())

line = sys.stdin.readline().strip()

to_move = 0

for i in range(a - 1):
    if (line[i] == line[i+1]):
        to_move += 1

print (to_move)

n = int(input())
line = input()
ans = 0
for i in range(1, len(line)):
    if line[i] == line[i - 1]:
        ans += 1
print(ans)


n = int(input())
t = input()
s, i = 0, 0
while i < n:
    x = t[i]
    i += 1
    while i < n and t[i] == x:
        i += 1
        s += 1
print(s)


n = int(input())
t = input()
s, x = 0, t[0]
for i in range(1, n):
    if t[i] == x:
        s += 1
    else:
        x = t[i]
print(s)


n = int(input())
t = input()
s = 0
for i in range(1, n):
    s += t[i] == t[i - 1]
print(s)

def stones():
    datain = []
    removed = 0
    for i in range(2):
        datain.append(input())    
    colors = datain[1]

    for i in range(len(colors)):
        if i == len(colors)-1:
            break
        else:
            if colors[i] == colors[i+1]:
                removed += 1

    print(removed)

stones()


n=int(input())
t=input()
m=0
for i in range(1, n):
    m +=t[i]==t[i-1]
print(m)

    
    


n = int(input())
s = input()
cnt = 0
for i in range(1,n):
    if s[i] == s[i-1]: cnt += 1

print(cnt)