You are given a set of n pens, each of them can be red, blue, green, orange, and violet in color. Count a minimum number of pens that should be taken out from the set so that any two neighboring pens have different colors. Pens are considered to be neighboring if there are no other pens between them.

-----Input:-----
- 
The first line contains t denoting the number of test cases.
- 
The first line of each test case will contain a single integer n.
- 
The second line of each test case will contain a string s.
(s contains only 'R', 'B', 'G', 'O', and 'V' characters denoting red, blue, green, orange, and violet respectively)

-----Output:-----
For each test case, print single line containing one integer - The minimum number of pens that need to be taken out.

-----Constraints-----
- $1 \leq T \leq 100$
- $1 \leq n \leq 1000$

-----Sample Input:-----
2
5
RBBRG
5
RBGOV

-----Sample Output:-----
1
0

-----EXPLANATION:-----
In first test case, two blue pens are neighboring each other, if we take out any one of them then the string will be RBRG in which each pen has different neighbors.
In second test case, no pen needs to be taken out as each pen has different neighbors.

Difficulty: interview

Starter code:

Solutions:
t = int(input())

for _ in range(t):
    n = int(input())
    a = input().strip()
    prev = a[0]
    ans = -1
    for i in a:
        if prev == i:
            ans += 1
        prev = i
    print(ans)


try:
    t=int(input())
    for _ in range(t):
        n=int(input())
        s=list(str(input()))[:n]
        i,c=0,0
        while(True):
            if(i>=len(s)-1):
                break
            if(s[i]==s[i+1]):
                c+=1
            i+=1
        print(c)                
except:
    pass

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

from sys import*
input=stdin.readline
t=int(input())
for _ in range(t):
    c=0
    n=int(input())
    s=input()
    for i in range(1,n):
        if s[i-1]==s[i]:
            c+=1
    print(c)

# cook your dish here
n=int(input())
for i in range(n):
    k=int(input())
    s=input();c=0
    for i in range(0,k-1):
        if (s[i]==s[i+1]):
            c=c+1
    print(c) 

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

# cook your dish here
for i in range(int(input())):
    n = int(input())
    count = 0
    colours = input()
    for j in range(1,n):
        if colours[j]==colours[j-1]:
            count += 1
            
    print(count)


# cook your dish here
for _ in range(int(input())):
    n=int(input())
    s=input()
    c=0
    if n==1:
        print("0")
    else:
        p=s[0]
        for i in range(1,n):
            if p==s[i]:
                c+=1
            p=s[i]
        print(c)

# cook your dish here

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

# cook your dish here
t=int(input())
for i in range(t):
    n=int(input())
    s=input()
    s=list(s)
    c=0
    for j in range(len(s)-1):
        if(s[j]==s[j+1]):
            c=c+1
    print(c)

# cook your dish here
def colour(s):
    c=0
    for i in range(len(s)-1):
        if(i==len(s)-1):
            break
        if (s[i]==s[i+1]):
           
            c+=1
    print(c)
t=int(input())
for _ in range(t):
    n=int(input())
    s=list(input())
    colour(s)

t=int(input())
for i in range(t):
	n=int(input())
	s=input()   #qwert 01234
	c=0
	for j in range(n):
	 	if(j+1<n):
	 		if(s[j]==s[j+1]):
	 			c=c+1
	print(c)		

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

testcase=int(input())
while testcase:
	l=int(input())
	data=input()
	count=0
	for i in range(l-1):
		if data[i]==data[i+1]:count+=1
	print(count)
	testcase-=1

t=int(input())
for _ in range(t):
    n=int(input())
    a=input()
    count=0
    i=0
    j=1
    while(i<n and j<n):
        if(a[i]==a[j]):
            count=count+1
        i=i+1
        j=j+1
    print(count)

# cook your dish here
for _ in range(int(input())):
    n = int(input())
    s = str(input())
    lst = []
    c = 0
    for i in range(n-1):
        if s[i] != s[i+1]:
            pass
        else:
            c += 1
    print(c)

t=int(input())
for _ in range(t):
    n=int(input())
    a=input()
    count=0
    i=0
    j=1
    while(i<n and j<n):
        if(a[i]==a[j]):
            count=count+1
        i=i+1
        j=j+1
    print(count)

t=int(input())
for _ in range(t):
    n=int(input())
    s=input()
    i=1
    c=0
    while i<n:
        if s[i]==s[i-1]:
            c+=1
        i+=1
    print(c)
            
    


try:
    t=int(input())
    for _ in range(t):
        n=int(input())
        l=input()
        i,res=0,0
        while(i<n):
            count=0
            while(i<n-1  and l[i]==l[i+1]):
                i+=1
                count+=1
            res+=count
            i+=1
        print(res)
except EOFError:
    pass

# cook your dish here
for t in range(int(input())):
    n=int(input())
    a=list(input())
    count=0
    j=1
    for i in range(0,n-1):
        if a[i]==a[j]:
            j+=1 
            count+=1
            pass
        else:
            j+=1
    print(count)

# cook your dish here

for _ in range(int(input())):
    n = int(input())
    arr = list(i for i in input())
    # print(arr)
    
    count=0
    char=arr[0]
    for j in range(1,n):
        if(char==arr[j]):
            # del arr[i]
            count+=1
        char = arr[j]
            
            
    
    # print(arr)
    print(count)


for _ in range(int(input())):
    lens = int(input())
    inps = input()
    stck = [inps[0]]
    need = 0
    for i in range(1, lens):
        if inps[i] == stck[-1]:
            need += 1
        else:
            stck.append(inps[i])
    print(need)


# cook your dish here
t = int(input())

for _ in range(t):
    n = int(input())
    s = str(input())
    prev = ''
    count = 0
    for i in s:
        if i == prev:
            count += 1
        else:
            prev = i
    
    print(count)

# cook your dish here
from collections import  deque
for i in range(int(input())):
    n=int(input())
    a=input()
    c=0
    for i in range(len(a)-1):
        if a[i]==a[i+1]:
            c+=1
    print(c)
        
        


# cook your dish here
tc=int(input())
for t in range(tc):
    n=int(input())
    st=input()
    c=0
    for i in range(1,n):
        if st[i]==st[i-1]:
            i+=1
            c+=1
    print(c)