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

Source: codeforces | Difficulty: EASY
Tags: Implementation


Solutions:
n = int(input(''))
s = input('')
count = 0
for i in range(len(s) - 1):
	if s[i] == 'R' and s[i + 1] == 'R' or (s[i] == 'B' and s[i + 1] == 'B') or (s[i] == 'G' and s[i + 1] == 'G'):
		count += 1
print(count)


number_of_stones = int(input())
stones = input()
counter = 0
for i in range(number_of_stones - 1):
	if stones[i] == stones[i + 1]:
		counter += 1
print(counter)


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


number_of_stone = int(input())
stones = input()
index = 0
count = 0
while index < len(stones) - 1:
	if stones[index] == stones[index + 1]:
		count += 1
	index += 1
print(count)


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


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


n = input()
x = input()
if int(n) == 1:
	print(0)
else:
	(a, b, count) = (0, 1, 0)
	while b < int(n):
		if x[a] == x[b]:
			(b, count) = (b + 1, count + 1)
		else:
			(a, b) = (b, b + 1)
	print(count)


def solution(n, stones):
	i = 0
	count = 0
	for i in range(1, len(stones)):
		if stones[i] == stones[i - 1]:
			count += 1
	return count

def main():
	(n, stones) = (int(input()), input())
	print(solution(n, stones))
main()


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


numstones = int(input())
stones = input()
takeout = 0
for i in range(1, numstones):
	if stones[i] == stones[i - 1]:
		takeout += 1
print(takeout)


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


n = int(input())
str = input()
list = []
for i in range(n - 1):
	list.append(str[i:i + 2])
print(list.count('RR') + list.count('GG') + list.count('BB'))


num = int(input())
s = input()
c = 0
b = []
for i in s:
	if b:
		if b[-1] == i:
			c += 1
		else:
			b.append(i)
	else:
		b.append(i)
print(c)


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


n = int(input())
colors = input()
delet_color = 0
first_color = colors[0]
num = len(colors)
for i in range(1, num):
	if first_color != colors[i]:
		first_color = colors[i]
	else:
		delet_color += 1
print(delet_color)


n = int(input())
s = list(input())
i = 1
count = 0
while len(s) != 1 and i < n - count:
	while i < n - count and s[i] == s[i - 1]:
		del s[i]
		count += 1
	i += 1
print(count)


n = int(input())
s = list(input())
tR = 0
tG = 0
tB = 0
for i in range(n - 1):
	if s[i] == s[i + 1]:
		if s[i] == 'R':
			tR += 1
		elif s[i] == 'G':
			tG += 1
		elif s[i] == 'B':
			tB += 1
print(tR + tG + tB)


y = int(input())
x = input()
j = 0
for i in range(1, len(x)):
	if x[i - 1] == x[i]:
		j = j + 1
print(j)


number = int(input())
fridge = [i for i in input()]
counter = 0
counter_index = -1
r = fridge.count('R')
b = fridge.count('B')
g = fridge.count('G')
c = 0
f = True
while counter_index != len(fridge):
	if f and r == len(fridge) or b == len(fridge) or g == len(fridge):
		counter = len(fridge) - 1
		break
	f = False
	counter_index += 1
	if counter_index + 1 == len(fridge):
		break
	if fridge[counter_index] == fridge[counter_index + 1]:
		del fridge[counter_index]
		c += 1
		counter_index -= 1
		counter += 1
print(counter)


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


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


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


n = int(input())
word = input()
count = 0
last = -1
for letter in word:
	if letter == last:
		count = count + 1
	last = letter
print(count)


n = input()
stones = input()
moves = 0
for i in range(len(stones) - 1):
	if stones[i] == stones[i + 1]:
		moves += 1
print(moves)


def main():
	n = int(input())
	line = input()
	p = line[0]
	count = 0
	for i in range(1, n):
		if line[i] == p:
			count += 1
		else:
			p = line[i]
	print(count)
main()


input()
stones = input()
counter = 0
temp_stone = stones[0]
for x in range(1, len(stones)):
	if stones[x] == temp_stone:
		counter += 1
	else:
		temp_stone = stones[x]
print(counter)


counter = 0
count = int(input())
rocks = list(input())
for i in range(len(rocks) - 1):
	if rocks[i] == rocks[i + 1]:
		counter += 1
print(counter)


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


a = int(input())
s = input()
s = list(s)
c = 0
i = 1
while i < a:
	flag = 1
	if s[i] == s[i - 1]:
		s.remove(s[i])
		c = c + 1
		a = a - 1
		flag = 0
	if flag == 1:
		i = i + 1
print(c)


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


n = int(input())
s = str(input())
lst = list(s)
l = len(lst)
count = 0
for i in range(0, l - 1):
	temp = lst[i]
	if lst[i + 1] == temp:
		count += 1
print(count)


n = int(input())
s = input()
c = 0
a = s[0]
k = 0
while k < len(s) - 1:
	k += 1
	if a == s[k]:
		c += 1
	a = s[k]
print(c)


a = int(input())
b = str(input())
l = []
l[:] = b
count = 0
for i in range(len(l) - 1):
	if l[i] == l[i + 1]:
		count = count + 1
	else:
		continue
print(count)


z = input
z()
s = z()
print(sum((s[i] == s[i - 1] for i in range(1, len(s)))))


a = int(input())
b = input()
l = list(b)
c = 0
for i in range(len(b) - 1):
	if b[i] == b[i + 1]:
		c = c + 1
print(c)


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


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


n = input()
a = input()
count = 0
k = a[1:]
for (i, j) in zip(a, k):
	if i == j:
		count = count + 1
print(count)


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


num = int(input())
string = input()
stones = [x for x in string]
i = 0
moves = 0
while i <= num - 2:
	if stones[i] == stones[i + 1]:
		moves += 1
	i += 1
print(moves)


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


k = int(input())
s = list(input())
i = 0
while i != len(s) - 1:
	if s[i] == s[i + 1]:
		del s[i]
		i -= 1
	i += 1
print(k - len(s))


n = input()
s = input()
s = list(s)
l = [s.pop(0)]
for color in s:
	if color != l[len(l) - 1]:
		l.append(color)
ans = len(s) + 1 - len(l)
print(ans)


size = int(input())
stones = list(input())
current = stones[0]
score = 0
for i in range(1, size):
	if stones[i] == current:
		score += 1
	else:
		current = stones[i]
print(score)


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


n = int(input())
s = input()
c = 2
if n > 1:
	if s[0] == s[1]:
		r = 1
	else:
		r = 0
	while c < n:
		if s[c] == s[c - 1]:
			r += 1
		c += 1
	print(r)
else:
	print(0)


import sys
result = 0
n = int(sys.stdin.readline().strip())
s = sys.stdin.readline().strip()
for i in range(n - 1):
	if s[i] == s[i + 1]:
		result += 1
print(result)


num = int(input())
stones = input()
listStones = list(stones)
counter = 0
for i in range(num):
	if all((elem == listStones[i] for elem in listStones)):
		counter = num - 1
	elif num <= 2:
		if listStones[i - 1] == listStones[i]:
			counter += 1
			break
	elif num > 2:
		if i >= 0 and i < num - 1:
			if listStones[i] == listStones[i + 1]:
				counter += 1
		elif i == num:
			if listStones[i - 1] == listStones[i]:
				counter += 1
print(counter)


import sys
lines = sys.stdin.readlines()
N = int(lines[0].strip())
nums = lines[1].strip()
count = 0
for i in range(1, N):
	if nums[i] == nums[i - 1]:
		count += 1
print(count)


length = int(input())
test = input()
count = 0
for i in range(length - 1):
	if test[i] == test[i + 1]:
		count += 1
print(count)


input()
s = input()
c = 0

def e(x):
	global s, c
	i = s.find(x)
	while i + 1:
		s = s[:i] + s[i + 1:]
		i = s.find(x)
		c += 1
e('RR')
e('BB')
e('GG')
print(c)


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


import math
import collections
import bisect
import heapq
import time
import random
import itertools
import sys
N = int(input())
S = input()
c = 0
p = ''
for v in S:
	if v == p:
		c += 1
	else:
		p = v
print(c)


num = input()
string = input()
lastStone = string[0]
count = 0
for i in range(1, len(string)):
	if string[i] == lastStone:
		count += 1
	lastStone = string[i]
print(count)


t = int(input())
n = input()
cnt = 0
for i in range(len(n) - 1):
	if n[i] == n[i + 1]:
		cnt += 1
		i = i + 2
	else:
		i = i + 1
print(cnt)


d = input()
a = input()
b = list(a)[0]
c = 0
for i in range(1, len(a)):
	if b == a[i]:
		c += 1
	else:
		b = a[i]
print(c)


Num = int(input())
List = [0] * Num
St = input()
for i in range(Num):
	List[i] = St[i]
count = 0
for k in range(Num - 1):
	if List[k] == List[k + 1]:
		count += 1
print(count)


n = int(input())
seq = input()
count = 0
for i in range(0, n - 1):
	if seq[0 + i:2 + i] == 'BB' or seq[0 + i:2 + i] == 'RR' or seq[0 + i:2 + i] == 'GG':
		count += 1
print(count)


a = input()
str = input()
count = 0
for i in range(0, len(str) - 1):
	if str[i] == str[i + 1]:
		count = count + 1
print(count)


cnt = int(input())
dt = list(input())
ans = 0
i = 0
while i < len(dt) - 1:
	if dt[i] == dt[i + 1]:
		dt.pop(i + 1)
		ans += 1
		i = 0
	else:
		i += 1
print(ans)


n = int(input())
s = input()
ans = 0
now = 1
for i in range(n):
	if i == 0 or s[i] != s[i - 1]:
		ans += now - 1
		now = 1
	else:
		now += 1
print(ans + now - 1)


n = int(input())
rgb = input()
colors = list(rgb)
colorsNEW = []
for i in range(n):
	try:
		if colors[i] == colors[i + 1]:
			colorsNEW.append(colors[i])
	except IndexError:
		break
print(len(colorsNEW))


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


def main():
	n = int(input())
	s = input()
	s1 = list(s)
	c = 0
	if n % 2 != 0:
		s1.append('q')
	for i in range(n - 1):
		if s1[i] == s1[i + 1]:
			c += 1
	print(c)
main()


n_stones = int(input())
stone_arrangement = input()
stones = (stone for stone in stone_arrangement)
no_removes = 0
if n_stones == 1:
	print(0)
else:
	left = next(stones)
	for i in range(n_stones - 1):
		right = next(stones)
		if right == left:
			no_removes += 1
		left = right
	print(no_removes)


n = int(input())
s = str(input())
v = 0
for x in range(len(s) - 1):
	if s[x] == s[x + 1]:
		v += 1
print(v)


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


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


lenght = int(input())
lista = list(map(str, input()))
cont = 0
for (n, i) in enumerate(lista):
	if i == 'R':
		lista[n] = 1
	elif i == 'G':
		lista[n] = 2
	else:
		lista[n] = 3
for x in range(lenght):
	if lista[x] == lista[max(0, x - 1)] and x != 0:
		cont = cont + 1
print(cont)


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


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


n = int(input())
s = input()
c = ''
answer = 0
for i in range(n):
	if s[i] == c:
		answer += 1
	else:
		c = s[i]
print(answer)


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


f = int(input())
s = input()
n = ''
d = 0
for i in range(len(s)):
	if s[i] == n:
		d += 1
	else:
		n = s[i]
print(d)


A = int(input())
B = input()
B = list(B)
h = 0

def proc(arr):
	t = 0
	if len(arr) > 1:
		if arr[0] == arr[1]:
			t = 1
	arr = arr.pop(0)
	return t
while len(B) > 0:
	h = h + proc(B)
print(h)


l1 = int(input())
l2 = str(input())
p = ['RR', 'BB', 'GG']
j = 0
if l1 > 1:
	for i in p:
		while i in l2:
			l2 = l2[:l2.find(i)] + l2[l2.find(i) + 1:]
			j += 1
print(j)


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


n = int(input())
s = str(input())
s1 = ''
s = s + ' '
for i in range(n):
	if s[i] != s[i + 1]:
		s1 = s1 + s[i]
print(n - len(s1))


num = int(input())
stones = input()
temp_s = stones[0]
rem = 0
for s in stones[1:]:
	if temp_s == s:
		rem += 1
	else:
		temp_s = s
print(rem)


_ = input()
stones = list(input())
new_alignment = []
new_alignment.append(stones[0])
count = 0
for (idx, stone) in enumerate(stones[1:], start=1):
	if stone == new_alignment[-1]:
		count += 1
	else:
		new_alignment.append(stone)
print(count)


n = int(input())
s = input()
p = 0
for j in range(len(s) - 1):
	if s[j] == s[j + 1]:
		p += 1
print(p)


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


l = int(input())
s = input()
s = list(s)
ns = 0
for i in range(0, len(s) - 1):
	if s[i] == s[i + 1]:
		ns += 1
print(ns)


import sys
input = sys.stdin.readline

def inp():
	return int(input())

def inlt():
	return list(map(int, input().split()))

def insr():
	s = input()
	return list(s[:len(s) - 1])

def invr():
	return map(int, input().split())
cnt = 0
n = inp()
s = insr()
if n > 1:
	for i in range(1, n - 1):
		if s[i] == s[i - 1]:
			cnt += 1
	if s[-1] == s[-2]:
		cnt += 1
	print(cnt)
else:
	print(0)


n = int(input())
s = input()
ans = 0
stack = []
for i in s:
	if stack:
		if stack[-1] == i:
			ans += 1
			continue
		else:
			stack.append(i)
	else:
		stack.append(i)
print(ans)


import math
n = int(input())
cnt = 0
lastCh = ''
line = input()
for ch in line:
	if lastCh != ch:
		lastCh = ch
	else:
		cnt += 1
print(cnt)


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


import sys
i = int(input())
words = list(input())
dicA = []
count = 0
for (index, x) in enumerate(words):
	if x in dicA and dicA[-1] == x:
		count += 1
	else:
		dicA.append(x)
print(count)
sys.exit()


n = int(input())
stones = input()
ans = []
total = 0
for i in range(n):
	if ans == []:
		ans.append(stones[i])
	elif stones[i] != ans[-1]:
		ans.append(stones[i])
	else:
		total += 1
print(total)


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


n = int(input())
s = input()
result = 0
last = s[0]
for color in s[1:]:
	if last == color:
		result += 1
	else:
		last = color
print(result)


kol = int(input())
ybr = 0
st = input()
for i in range(kol - 1):
	if st[i] == st[i + 1]:
		ybr += 1
print(ybr)


result = 0
n = int(input())
a = input()
for i in range(n - 1):
	s = a[i:i + 2]
	if s == 'RR' or s == 'GG' or s == 'BB':
		result += 1
print(result)


N = int(input())
A = input()
M = 0
Elem = A[0]
k = 0
while k < len(A) - 1:
	k += 1
	if Elem == A[k]:
		M += 1
	Elem = A[k]
print(M)


input()
s = input()
b = 0
for i in range(1, len(s)):
	if s[i] == s[i - 1]:
		b += 1
print(b)


import itertools
i = input()
i = input()
p = list(itertools.groupby(i))
print(len(i) - len(p))


n = int(input())
string = str(input())
k = []
for i in string:
	k.append(i)
num = 0
for i in range(1, len(k)):
	if k[i - 1] == k[i]:
		num += 1
print(num)


def removedStones(s):
	count = 0
	for i in range(len(s) - 1):
		firstStone = s[i]
		if s[i] == s[i + 1]:
			count += 1
	return count
n = int(input())
print(removedStones(input()))


a = input()
s = input()
l1 = len(s)
s = 'A' + s + 'A'
i = 1
while i < len(s) - 1:
	if s[i] == s[i - 1] or s[i] == s[i + 1]:
		s = s[0:i] + s[i + 1:len(s)]
		i -= 1
	i += 1
print(l1 - len(s) + 2)


n = input()
n = int(n)
s = list()
temp = input()
s.extend(temp)
count = 0
for i in range(1, n):
	if s[i] == s[i - 1]:
		count += 1
print(count)


N = int(input())
strings = str(input())
count = 0
for i in range(len(strings)):
	if i != len(strings) - 1:
		if strings[i] == strings[i + 1]:
			count += 1
print(count)


n = int(input())
piedras = input()
lista_inutil = []
for i in range(10000):
	lista_inutil.append(i ** 2)
contador = 0
for i in range(n - 1):
	if piedras[i] == piedras[i + 1]:
		contador += 1
print(contador)


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


x = input()
s = input()
new = s[0]
for i in range(len(s)):
	if i == 0:
		continue
	if s[i] is not s[i - 1]:
		new += s[i]
print(len(s) - len(new))


input()

def RGB(s):
	c = 0
	for i in range(len(s) - 1):
		j = i + 1
		if s[i] == s[j]:
			c += 1
	return c
print(RGB(input()))


a = int(input())
b = str(input())
c = 0
for i in range(0, a - 1):
	if b[i] == b[i + 1]:
		c = c + 1
	else:
		continue
print(c)


a = input()
colors = str(input())
length = -len(colors)
i = -1
cntr = 0
while i != length:
	if colors[i] == colors[i - 1]:
		cntr += 1
	i -= 1
print(cntr)


(r, g, b) = (0, 0, 0)
n = int(input())
s = input()
for i in range(len(s) - 1):
	if s[i] == s[i + 1]:
		if s[i] == 'R':
			r += 1
		elif s[i] == 'G':
			g += 1
		elif s[i] == 'B':
			b += 1
print(r + g + b)


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


a = int(input())
b = input()
c = '0'
d = 0
for i in range(a):
	if b[i] == c:
		d += 1
	else:
		c = b[i]
print(d)


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


num = int(input())
inp = list(input())
c = 0
for i in range(len(inp) - 1):
	if inp[i] == inp[i + 1]:
		c += 1
print(c)


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


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


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


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


number = int(input())
colors_stone = input()
sol = 0
for i in range(number - 1):
	if colors_stone[i] == colors_stone[i + 1]:
		sol += 1
print(sol)


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


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


x = int(input())
y = input()
count = 0
z = len(y)
for i in range(0, x - 1):
	if y[i] == y[i + 1]:
		count += 1
print(count)


x = int(input())
m = input()
e = 0
b = 0
while e < x - 1:
	if m[e] == m[e + 1]:
		b += 1
	e += 1
print(b)


n = int(input())
w = input()
i = 1
l = len(w)
c = 0
while i < l:
	if w[i - 1] == w[i]:
		c = c + 1
	i = i + 1
print(c)


t = int(input())
s = input()
l = [i for i in s]
c = 0
n = len(l)
i = 1
while i < n:
	if l[i] == l[i - 1]:
		del l[i]
		n -= 1
	else:
		i += 1
print(len(s) - len(l))


n = int(input())
x = input()
y = list(x)
previous = x[0]
count = 0
for i in range(1, n):
	if x[i] == previous:
		count = count + 1
	previous = x[i]
print(count)


n = int(input())
stones = input()
res = 0
i = 1
while i < len(stones):
	while i < len(stones) and stones[i - 1] == stones[i]:
		res += 1
		i += 1
	i += 1
print(res)


y = input()
s = input()
k = s[0]
res = k
for c in s[1:]:
	if k != c:
		res += c
	k = c
print(len(s) - len(res))


lst = []
count = 0
n = int(input())
lst = input()
for i in range(len(lst) - 1):
	if i == len(lst):
		break
	elif lst[i] == lst[i + 1]:
		count += 1
print(count)


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


n = int(input())
s = list(input())
print(sum((s[i] == s[i + 1] for i in range(n - 1))))


N = int(input())
S = input()
P = 0
R = 0
for i in range(1, N):
	if S[i] == S[P]:
		R += 1
	else:
		P = i
print(R)


def solution(stones):
	ctr = 0
	for i in range(len(stones) - 1):
		if stones[i] == stones[i + 1]:
			ctr += 1
	return ctr
n = int(input())
stones = input()
print(solution(stones))


number_stone = int(input())
string = input()
index = 0
count = 0
while index < number_stone:
	if string[index] == string[index + 1:index + 2]:
		count += 1
	index += 1
print(count)


num = int(input())
stones = list(input())
cons = 0
for i in range(num - 1):
	if stones[i] == stones[i + 1]:
		cons += 1
print(cons)


n = int(input())
a = input()
t = []
for i in range(n - 1):
	if a[i] != a[i + 1]:
		t.append(a[i])
t.append(a[n - 1])
print(n - len(t))


num = int(input())
word = input()
count = 0
for i in range(len(word) - 1):
	if word[i] == word[i + 1]:
		count += 1
print(count)


n = int(input())
x = input()
count = 0
i = 0
j = 0
while i < n - 1:
	j = i + 1
	while j < n and x[i] == x[j]:
		count = count + 1
		j = j + 1
	i = j
print(count)


input()
stones = input()
count = 0
for i in range(len(stones) - 1):
	if stones[i] == stones[i + 1]:
		count += 1
print(count)


n = int(input())
a = input()
i = 1
b = []
b.append(a[0])
while i < n:
	if a[i] != b[-1]:
		b.append(a[i])
	i += 1
print(n - len(b))


n = input()
s = input()
removeStone = 0
for x in range(len(s) - 1):
	if s[x] == s[x + 1]:
		removeStone += 1
print(removeStone)


import os
import sys
from io import BytesIO, IOBase
import math
from decimal import *
getcontext().prec = 25
MOD = pow(10, 9) + 7
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')
n = int(input())
a = input()
c = 0
curr = a[0]
for i in range(1, n):
	if a[i] == curr:
		c += 1
	curr = a[i]
print(c)


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


import sys
import math
n = int(input())
stra = str(input())
cona = 0
for i in range(n - 1):
	if stra[i] == stra[i + 1]:
		cona += 1
print(cona)


numOfStones = input()
stoneLine = input()
listedStones = list(stoneLine)
counter = 0
for i in range(len(listedStones) - 1):
	if listedStones[i] == listedStones[i + 1]:
		counter += 1
print(counter)


a = int(input(''))
b = input('')
count = 0
for i in range(1, a):
	if b[i] == b[i - 1]:
		count += 1
print(count)


n_stones = int(input())
stones = input()
last_different_stone = stones[0]
removed_count = 0
for i in range(1, len(stones)):
	if last_different_stone != stones[i]:
		last_different_stone = stones[i]
	else:
		removed_count += 1
print(removed_count)


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


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


a = int(input())
b = list(input())
c = []
for i in range(len(b)):
	if i == 0:
		c.append(b[i])
	elif (b[i] is c[len(c) - 1]) == False:
		c.append(b[i])
print(len(b) - len(c))


input()
n = input()
m = []
for char in n:
	m.append(char)
count = 0
for i in range(0, len(m) - 1):
	if m[i] == m[i + 1]:
		count += 1
print(count)


n = int(input())
s = input()
c = []
count = 0
m = s[0]
for i in range(n):
	if s[i] == m:
		count += 1
	else:
		c.append(count)
		m = s[i]
		count = 1
c.append(count)
num = 0
for i in c:
	if i > 1:
		num += i - 1
print(num)


import re
q = input()
x = input()
y = x
while re.search('RR', x) or re.search('GG', x) or re.search('BB', x):
	result_r = re.sub('RR', 'R', x)
	result_g = re.sub('GG', 'G', result_r)
	result_b = re.sub('BB', 'B', result_g)
	x = result_b
if re.search('RR', y) or re.search('GG', y) or re.search('BB', y):
	print(len(y) - len(result_b))
else:
	print(0)


x = int(input())
y = input()
main = []
for a in range(x):
	main.append(y[a])
check = 0
for a in range(x - 1):
	if main[a] == main[a + 1]:
		check += 1
print(check)


n = int(input())
m = input()
c = 0
for x in range(len(m) - 1):
	if m[x] == m[x + 1]:
		c = c + 1
print(c)


input()
s = input()
summ = 0
try:
	for i in range(len(s) - 1):
		if s[i] == s[i + 1]:
			summ += 1
	print(summ)
except Exception:
	print(0)


nmbr = int(input())
clrs = input()
nghbr = 0
for i in range(nmbr - 1):
	if clrs[i] == clrs[i + 1]:
		nghbr += 1
print(nghbr)


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


n = int(input())
array = []
string = input()
for letter in string:
	array.append(letter)
totalCount = 0
currentLetter = ''
for letter in array:
	if currentLetter == letter:
		totalCount += 1
	else:
		currentLetter = letter
print(totalCount)


n = int(input())
st = input()
count = 0
if n <= 1:
	print(0)
else:
	for i in range(len(st) - 1):
		if st[i] == st[i + 1]:
			count += 1
	print(count)


(_, count) = (input(), 0)
string = input()
for (index, char) in enumerate(string):
	try:
		if char == string[index + 1]:
			count += 1
	except:
		pass
print(count)


try:
	n = int(input())
	s = str(input())
	c = 0
	for i in range(1, n):
		if s[i - 1] == s[i]:
			c += 1
		else:
			continue
	print(c)
except:
	pass


a = int(input())
b = input()
c = list(b)
i = 0
k = 0
while i < a - 1:
	if c[i] == c[i + 1]:
		k = k + 1
	i = i + 1
print(k)


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


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


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


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


n = int(input())
s = input().upper()
if len(s) == 1:
	print(0)
else:
	m = 0
	for i in range(1, len(s)):
		if s[i - 1] == s[i]:
			m = m + 1
	print(m)


len = int(input())
s = input()
counter = 0
for i in range(len):
	if i + 1 < len and s[i] == s[i + 1]:
		counter += 1
print(counter)


a = int(input())
stones = input()
counter = 0
result = 0
for i in stones:
	if counter < a - 1 and stones[counter + 1] is i:
		result += 1
	counter += 1
print(result)


n = int(input())
inputStrList = list(input())
ansList = []
for i in range(1, n):
	if inputStrList[i - 1] == inputStrList[i]:
		ansList.append(inputStrList[i - 1])
print(len(ansList))


m = 0
n = int(input())
s = [i for i in input()]
if n == 1:
	print(0)
	exit()
a = s[0]
for i in range(n - 1):
	b = s[i + 1]
	if a == b:
		m += 1
	else:
		a = s[i + 1]
print(m)


n = int(input())
string = input()
if len(string) == len(set(string)):
	print(0)
elif len(set(string)) == 1:
	print(len(string) - 1)
else:
	count = 0
	for i in range(len(string) - 1):
		if string[i] == string[i + 1]:
			count += 1
		else:
			continue
	print(count)


l = int(input())
t = input()
arr = []
count = 0
for i in t:
	arr.append(i)
for j in range(l - 1):
	if arr[j] == arr[j + 1]:
		count += 1
print(count)


length = int(input())
str1 = input().strip('\n\r')
ans = 0
for i in range(1, length):
	if str1[i] == str1[i - 1]:
		ans += 1
print(ans)


a = int(input())
b = str(input())
check = 0
for i in range(len(b) - 1):
	if b[i] == b[i + 1]:
		check += 1
print(check)


n = int(input())
row = list(input())
moves = 0
i = 0
while i < len(row) - 1:
	if row[i] == row[i + 1]:
		del row[i]
		moves = moves + 1
	else:
		i = i + 1
print(moves)


count = 0
n = int(input())
while not 1 <= n <= 50:
	n = int(input())
k = list(map(str, input()))
for i in k:
	while (i != 'R' or i != 'G' or i != 'B') and len(k) > n:
		k = list(map(str, input()))
for i in range(n - 1):
	if k[i] == k[i + 1]:
		count += 1
print(count)


t = int(input())
s = input()
j = ''
c = 0
for i in range(t):
	h = s[i]
	if h == j:
		c = c + 1
	else:
		j = h
print(c)


def solve(n, stones):
	moves = 0
	for i in range(1, n):
		if stones[i] == stones[i - 1]:
			moves += 1
	return moves
n = int(input())
str = input()
print(solve(n, str))


def answer():
	a = int(input())
	b = list(input())
	i = 0
	c = b[0]
	d = [b[0]]
	while i < len(b):
		if b[i] == c:
			pass
		else:
			c = b[i]
			d.append(c)
		i += 1
	return len(b) - len(d)
print(answer())


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


(n, s) = (int(input()), 0)
l = list(input())
for i in range(n - 1):
	if l[i] == 'R' and l[i + 1] == 'R':
		s += 1
	elif l[i] == 'G' and l[i + 1] == 'G':
		s += 1
	elif l[i] == 'B' and l[i + 1] == 'B':
		s += 1
print(s)


from sys import stdin, stdout, exit as sys_ret
(f_input, f_print, f_flush) = (stdin.readline, stdout.write, stdout.flush)
(amount, count) = (int(f_input()), 0)
string = f_input().replace('\n', '')
for i in range(1, len(string)):
	if string[i - 1] == string[i]:
		count += 1
f_print(str(count))


num = int(input())
arr = input()
count = 0
for cond in ['RR', 'GG', 'BB']:
	while cond in arr:
		count += 1
		index = arr.index(cond)
		arr = arr[:index] + arr[index + 1:]
print(count)


i = int(input())
lt = list(input())
x = 0
for a in range(i - 1):
	if lt[a] == lt[a + 1]:
		x += 1
print(x)


n = int(input())
stones = input()
pre = ''
count = 0
for color in stones:
	if pre == color:
		count += 1
	pre = color
print(count)


a = int(input())
s = input()
print(sum((s[i] == s[i + 1] for i in range(0, a - 1))))


import sys
lines = sys.stdin.readlines()
order = lines[1]
sample = []
for character in order:
	sample += [character]
if lines[0] == 1:
	print(0)
else:
	k = 0
	for i in range(len(sample) - 1):
		if sample[i] == sample[i + 1]:
			k += 1
print(k)


n = int(input())
s = input()
i = 0
a = ''
while i < n:
	j = i
	a += s[i]
	while s[j] == s[i]:
		j += 1
		if j == n:
			break
	i = j
print(n - len(a))


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


x = int(input())
y = input()
z = 0
i = 0
while i != x - 1:
	if y[i] == y[i + 1]:
		z += 1
	i += 1
print(z)


def Main():
	(n, s) = (int(input()), input())
	init = s
	arr = ['RR', 'GG', 'BB']
	for x in arr:
		while s.find(x) != -1:
			s = s.replace(x, x[0])
	print(len(init) - len(s))
Main()


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


K = int(input())
Stones = input()
prev = Stones[0]
index = 1
Count = 0
while index < K:
	if prev == Stones[index]:
		Count += 1
	else:
		prev = Stones[index]
	index += 1
print(Count)


x = input()
a = input()
c = 0
for i in range(0, len(a) - 1):
	if a[i] == a[i + 1]:
		c = c + 1
print(c)


numberOfStones = int(input())
sequence = input()
removals = 0
for i in range(1, numberOfStones):
	if sequence[i - 1] == sequence[i]:
		removals = removals + 1
print(removals)


n = int(input())
seq = str(input())
prevchar = ''
remove = 0
for char in seq:
	if char == prevchar:
		remove += 1
	else:
		prevchar = char
print(remove)


from sys import stdin, stdout
n = stdin.readline()
st = stdin.readline()
c = 0
for i in range(int(n) - 1):
	if st[i] == st[i + 1]:
		c = c + 1
print(c)


lenght = int(input())
stone_color = input()
counter = 0
for i in range(1, lenght):
	if stone_color[i - 1] == stone_color[i]:
		counter += 1
print(counter)


n = int(input())
x = input()
f = 0
a = x[0]
for i in range(1, n):
	if x[i] == a:
		f += 1
		continue
	a = x[i]
print(f)


n = int(input())
stones = str(input())
i = 0
j = 1
cnt = 0
while j < n:
	if stones[i] == stones[j]:
		cnt += 1
	i += 1
	j += 1
if cnt > 0:
	print(cnt)
else:
	print('0')


n = int(input())
s = input()
a = []
c = 0
for i in range(n):
	a.append(s[i])
for i in range(len(a)):
	for j in range(len(a) - 1):
		if a[j] == a[j + 1]:
			a[j] = i
			c += 1
			break
print(c)


n = int(input())
str = input()
r = 0
b = 0
g = 0
t = 0
for i in str:
	if i == 'R':
		b = 0
		g = 0
		r += 1
		if r >= 2:
			t += 1
	if i == 'B':
		r = 0
		g = 0
		b += 1
		if b >= 2:
			t += 1
	if i == 'G':
		r = 0
		b = 0
		g += 1
		if g >= 2:
			t += 1
print(t)


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


input()
stones = input()
to_remove = 0
last_stone = stones[0]
for stone in stones[1:]:
	if stone == last_stone:
		to_remove += 1
	last_stone = stone
print(to_remove)


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


n = int(input())
list1 = list(input())
list2 = []
for m in range(0, n - 1):
	if list1[m] != list1[m + 1]:
		list2.append(list1[m])
list2.append(list1[n - 1])
print(len(list1) - len(list2))


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


input()
line = input()
removedChars = 0
ch = line[0]
for i in range(1, len(line)):
	if line[i] == ch:
		removedChars += 1
	else:
		ch = line[i]
print(removedChars)


def rem(s):
	if len(s) == 1:
		return 0
	c = 0
	(p1, p2) = (0, 1)
	while p2 < len(s):
		while p2 < len(s) and s[p1] == s[p2]:
			p2 += 1
		s = s[:p1 + 1] + s[p2:]
		c += p2 - p1 - 1
		(p1, p2) = (p1 + 1, p1 + 2)
	return c
n = input()
s = input()
print(rem(s))


input()
s = list(input())
c = 0
i = 0
while True:
	try:
		if s[i] == s[i + 1]:
			del s[i + 1]
			c += 1
		else:
			i += 1
	except:
		break
print(c)


n = int(input())
s = str(input())
q = 0
for i in range(n - 1):
	if s[i] == 'R' and s[i + 1] == 'R':
		q += 1
	elif s[i] == 'B' and s[i + 1] == 'B':
		q += 1
	elif s[i] == 'G' and s[i + 1] == 'G':
		q += 1
print(q)


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


import sys
num = int(input())
s = input()
count = 0
for i in range(num):
	if i == num - 1:
		print(count)
		sys.exit()
	elif s[i] == s[i + 1]:
		count += 1
	else:
		continue


from sys import stdin, stdout
inp = input()
stack = []
string = list(input())
stack.append('z')
count = 0
for i in string:
	if stack[-1] == i:
		count += 1
	else:
		stack.append(i)
print(count)


input()
a = input()
c = a[0]
l = -1
for i in a:
	if i == c:
		l = l + 1
	else:
		c = i
print(l)


def seperateints(x):
	k = ''
	l = []
	for i in x:
		if i == ' ':
			l.append(int(k))
			k = ''
			continue
		k = k + i
	l.append(int(k))
	return l
n = int(input())
s = input()
k = 0
i = 0
f = 0
while i < n:
	if i == n - 1:
		break
	nnn = 1
	while True:
		if s[i] == s[i + nnn]:
			k += 1
			if i + nnn == n - 1:
				f += 1
				break
			nnn += 1
		else:
			i = i + nnn
			break
	if f != 0:
		break
print(k)


n = int(input())
color = input()
sub_color = list()
for i in range(0, len(color) - 1):
	sub_color.append(color[i:i + 2])
count = 0
for i in sub_color:
	if len(set(i)) == 1:
		count += 1
print(count)


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


number_of_stones = int(input())
color_sequense = input()
series = color_sequense[0]
count = -1
for color in color_sequense:
	if color == series:
		count += 1
		series = color_sequense[color_sequense.index(color)]
	else:
		series = color_sequense[color_sequense.index(color)]
print(count)


n = int(input())
p = list(input())
p.append(0)
z = 0
i = 0
while i < n + 1:
	q = 0
	for j in range(i, n):
		if p[j] == p[j + 1]:
			q += 1
			continue
		else:
			z += q
			break
	if q != 0:
		i += q
	else:
		i += 1
print(z)


def count_neighbour(string):
	count = 0
	for i in range(0, len(string) - 1):
		if i == len(string):
			break
		if string[i] == string[i + 1]:
			count = count + 1
	return count
input_n = int(input())
string = input()
print(count_neighbour(string))


n = int(input())
s = input()
st = list(s)
count = 0
for i in range(0, n):
	for j in range(0, len(st) - 1):
		if st[j] == st[j + 1]:
			del st[j + 1]
			count = count + 1
			break
print(count)


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


n = int(input())
colors = [char for char in input()]
count = 0
prev = colors[0]
for c in colors[1:]:
	if c == prev:
		count += 1
	prev = c
print(count)


input()
s = input()
t = '!'
res = 0
for x in s:
	if x == t:
		res += 1
	t = x
print(res)


n = int(input())
s = input()
curr = s[0]
g = 1
for i in range(1, len(s)):
	if s[i] != curr:
		curr = s[i]
		g += 1
print(str(len(s) - g))


n = int(input())
color = list(input())
t = 0
i = 1
while i < len(color):
	if len(color) <= 1:
		print(t)
		exit()
	elif color[i - 1] == color[i]:
		color.pop(i)
		t += 1
	else:
		i += 1
print(t)


a = input()
a = input().strip()
res = 0
for i in range(1, len(a)):
	if a[i] == a[i - 1]:
		res += 1
print(res)


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


n = int(input())
s = input()
G = 0
first = 'x'
for i in s:
	if first == i:
		G = G + 1
	first = i
print(G)


num = int(input())
stones = input()
count_R = 0
count_B = 0
count_G = 0
count = 0
for i in stones:
	if i == 'R':
		count_B = 0
		count_G = 0
		count_R += 1
		if count_R >= 2:
			count += 1
	elif i == 'B':
		count_B += 1
		count_R = 0
		count_G = 0
		if count_B >= 2:
			count += 1
	else:
		count_B = 0
		count_R = 0
		count_G += 1
		if count_G >= 2:
			count += 1
print(count)


n = int(input())
string = input()
(c, p) = (0, 0)
for i in range(1, len(string)):
	if string[i] == string[p]:
		c += 1
	else:
		p = i
print(c)


n = input()
line = input()
res = 0
for (i, c) in enumerate(line[:-1]):
	if line[i] == line[i + 1]:
		res += 1
print(res)


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


def main(stdin):
	n = int(next(stdin))
	line = next(stdin)
	count = 0
	last = None
	for char in range(len(line)):
		if line[char] == last:
			count += 1
		last = line[char]
	print(count)
import sys
main(sys.stdin)


n = int(input())
stones = str(input())
res = stones[0]
count = 0
for i in range(1, n):
	if stones[i] != stones[i - 1]:
		res += stones[i]
	else:
		count += 1
print(count)


row = int(input())
stones = input()
res = [stones[0]]
for s in range(len(stones))[1:]:
	if res[-1] != stones[s]:
		res.append(stones[s])
ans = len(stones) - len(res)
print(ans)


n = input()
answer = ''
counter = 0
entry = input()
l = len(entry)
answer = entry[0]
for i in range(l - 1):
	if entry[i] != entry[i + 1]:
		answer = answer + entry[i + 1]
	elif entry[i] == entry[i + 1]:
		counter = counter + 1
print(counter)


a = int(input())
b = input()
c = len(b)
i = 0
while i < len(b):
	if i == len(b) - 1:
		pass
	elif b[i] == b[i + 1]:
		c -= 1
	i += 1
print(len(b) - c)


a = int(input(''))
x = list(input(''))
i = 0
s = 0
while i < a - 1:
	if x[i] == x[i + 1]:
		s += 1
	i = 1 + i
print(s)


def main():
	n = int(input())
	lis = list(input())
	ans = 0
	for c in range(n):
		if c != n - 1:
			if lis[c] == lis[c + 1]:
				ans += 1
	print(ans)
main()


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


from sys import stdin

def n_stones(stones) -> int:
	n = 0
	for i in range(1, len(stones)):
		if stones[i - 1] == stones[i]:
			n += 1
	return n

def main():
	n = stdin.readline().strip()
	SALIDA = []
	while len(n) != 0:
		SALIDA.append(str(n_stones(stdin.readline().strip())))
		n = stdin.readline().strip()
	print('\n'.join(SALIDA))
main()


n = int(input())
sp = list(input())
sum = 0
flg = True
while flg:
	flg = False
	for i in range(len(sp)):
		if i + 1 < len(sp):
			if sp[i] == sp[i + 1]:
				sum += 1
				flg = True
				del sp[i + 1]
print(sum)


p = int(input())
k = input()
count = 0
n = 0
while n < len(k) - 1:
	i = k[n + 1]
	l = k[n]
	if i == l:
		k = k[:n + 1] + k[n + 2:]
	if i != l:
		n = n + 1
print(p - len(k))


number = int(input())
string = input()
current = string[0]
count = 0
for i in range(1, number):
	if string[i] == current:
		count += 1
	else:
		current = string[i]
print(count)


def deci(b, s):
	c = 0
	for i in range(1, b):
		if s[i] == s[i - 1]:
			c += 1
	return c
b = int(input())
s = input()
x = deci(b, s)
print(x)


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


def Piedra(N, s):
	x = 0
	while N > 0:
		N -= 1
		if N == 0:
			return x
		if s[N] == s[N - 1]:
			x += 1
	return x
N = int(input())
s = str(input())
print(Piedra(N, s))


a = int(input())
b = input()
c = ''
d = 0
for i in range(0, a):
	if not i == a - 1 and b[i] == b[i + 1]:
		d += 1
print(d)


counter = 0
n = int(input('\n'))
word = input()
if len(word) > n or len(word) < n:
	print('please print a valid num of characters\n')
else:
	for i in range(1, len(word)):
		if word[i] == word[i - 1]:
			counter += 1
		else:
			continue
print(counter)


def replace(str, charSet):
	for singleChr in charSet:
		pattern = singleChr * len(str)
		while len(pattern) > 0:
			str = str.replace(pattern, singleChr)
			pattern = pattern[1:]
	return str
print(int(input()) - len(replace(input(), 'RGB')))


n = int(input())
ipt = input()
mem = ipt[0]
counter = 0
for i in range(1, n):
	if ipt[i] == mem:
		counter += 1
	mem = ipt[i]
print(counter)


n = input()
n = int(n)
stones = input()
steps = 0
for i in range(len(stones)):
	if i < len(stones) - 1:
		if stones[i] == stones[i + 1]:
			steps = steps + 1
	if i < len(stones) - 1 and i > 0:
		if stones[i] != stones[i + 1] and stones[i] != stones[i - 1]:
			pass
print(steps)


s = int(input())
stones = list(input())
stones_removed = 0
for i in range(s - 1):
	if stones[i] == stones[i + 1]:
		stones_removed += 1
	else:
		pass
print(stones_removed)


n = int(input())
color = input()
c = list(color)
count = 0
for i in range(len(color) - 1):
	if c[i] == c[i + 1]:
		count += 1
print(count)


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


n = int(input())
s = input()
n1 = n2 = n3 = 0
for i in range(1, n):
	if s[i] == s[i - 1] == 'R':
		n1 += 1
	elif s[i] == s[i - 1] == 'B':
		n2 += 1
	elif s[i] == s[i - 1] == 'G':
		n3 += 1
print(n1 + n2 + n3)


_len = int(input())
stones = input()
last = stones[0]
count = 0
for index in range(1, _len):
	if stones[index] == last:
		count += 1
	last = stones[index]
print(count)


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


n = int(input())
color = list(input())
answ = 0
i = 0
while i != n - 1:
	if color[i] == color[i + 1]:
		answ += 1
	i += 1
print(answ)


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


n = int(input(''))
color = str(input())
count_stone = 0
for i in range(n - 1):
	if color[i] == color[i + 1]:
		count_stone += 1
print(count_stone)


n = int(input())
alist = input()
last_index = 0
to_remove = 0
for i in range(1, n):
	current_c = alist[i]
	if alist[last_index] == current_c:
		to_remove += 1
	else:
		last_index = i
print(to_remove)


item = 0
count = 0
n = input()
string = list(input())
while item < len(string) - 1:
	if string[item] == string[item + 1]:
		del string[item]
		count += 1
	else:
		item += 1
print(count)


n = int(input())
l = list(input())
k = len(l)
before = l[0]
num = 0
for i in range(1, k):
	if l[i] == before:
		num += 1
	else:
		before = l[i]
print(num)


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


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


def stone(x=[]):
	j = 0
	for i in range(0, len(x) - 1):
		if x[i] == x[i + 1]:
			j = j + 1
	print(j)
nbr = input().strip('\n')
x = input().strip('\n')
if len(x) == int(nbr):
	stone(x)


import sys
n = sys.stdin.readline().rstrip()
s1 = sys.stdin.readline().rstrip()
last = ''
ss = 0
for i in s1:
	if i == last:
		ss += 1
	last = i
print(ss)


n = int(input())
s = input()
c = 0
prev = 'abcd'
for i in range(n):
	if prev == s[i]:
		c += 1
	prev = s[i]
print(c)


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


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


n1 = int(input())
n = input()
if len(set(n)) == 1:
	print(len(n) - 1)
else:
	count = 0
	n = list(n)
	for i in range(len(n) - 1):
		if n[i] == n[i + 1]:
			count += 1
	print(count)


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


n = int(input().strip())
stone = input().strip()
count = 0
char = stone[0]
for i in range(1, n):
	if char == stone[i]:
		count += 1
	char = stone[i]
print(count)


h = int(input())
c = list(input())
count = 0
for i in range(h - 1):
	if c[i] == c[i + 1]:
		count += 1
print(count)


def rocks(row):
	count = 0
	for i in range(1, len(row)):
		if row[i - 1] == row[i]:
			count += 1
	return count
n = int(input())
row = input()
print(rocks(row))


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


t = lambda s: len(s) - len((lambda c: [a for [a, b] in zip(c, '.' + c) if a != b])(s))
input()
print(t(input()))


def main():
	input()
	data = input()
	ans = 0
	for i in range(1, len(data)):
		if data[i] == data[i - 1]:
			ans += 1
	print(ans)
	pass
main()


n = int(input())
s = input()
pref = ''
ct = 0
for i in range(n):
	if s[i] != pref:
		pref = s[i]
	else:
		ct += 1
print(ct)


def codeforces(l):
	temp = [l[0]]
	j = 1
	for i in range(1, len(l)):
		if l[i] == temp[i - j]:
			j += 1
		else:
			temp.append(l[i])
	return temp
n = int(input())
l = list(input())
temp = codeforces(l)
print(abs(len(temp) - len(l)))


firstString = int(input())
secondString = input()
currentElem = secondString[0]
counter = 0
for i in range(1, firstString):
	if currentElem == secondString[i]:
		counter += 1
	currentElem = secondString[i]
print(counter)


(_, s) = (input(), input())
l = [1 if x == p else 0 for (x, p) in zip(s, '#' + s)]
print(sum(l))


_ = input()
seq = list(input())
count = 0
lastChar = ''
while seq:
	i = seq.pop(0)
	if lastChar == i:
		count += 1
	lastChar = i
print(count)


from itertools import groupby
n = int(input().strip())
st = input().strip()
ans = 0
for x in groupby(st):
	li = list(x[1])
	if len(li) > 1:
		ans += len(li) - 1
print(ans)


input()
s = input()

def stones(string):
	if len(string) == 1:
		return 0
	elif string[0] == string[1]:
		return 1 + stones(string[1:])
	else:
		return stones(string[1:])
print(stones(s))


num_loops = int(input())
stones = input()
num_remove = 0
stones_list = []
for i in range(len(stones)):
	stones_list.append(stones[i])
i = 0
while i < num_loops:
	if i + 1 < len(stones_list):
		if stones_list[i + 1] == stones_list[i]:
			num_remove += 1
			i -= 1
			del stones_list[i + 1]
	i += 1
print(num_remove)


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


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


d = {'R': 0, 'B': 0, 'G': 0}
n = int(input())
s = input()
for _ in range(n - 1):
	if s[_] == s[_ + 1]:
		d[s[_]] += 1
m = 0
for _ in d:
	m += d[_]
print(m)


n = int(input())
l = list(input())
idx = 1
id = 0
c = 0
while idx < n:
	if l[idx] == l[id]:
		c = c + 1
	idx = idx + 1
	id = id + 1
print(c)


l = int(input())
s = input()
cn = 0
for item in range(1, l):
	if s[item] == s[item - 1]:
		cn += 1
print(cn)


length = int(input())
colors = input()
remove = 0
for i in range(1, length):
	if colors[i] == colors[i - 1]:
		remove += 1
print(remove)


stones = int(input())
colors = list(input())
count = 0
for i in range(len(colors) - 1):
	if colors[i] == colors[i + 1]:
		count = count + 1
print(count)


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


a = int(input())
s = input()
b = []
for i in s:
	b.append(i)
_ = 0
for i in range(a - 1):
	if b[i] == b[i + 1]:
		_ += 1
	else:
		pass
print(_)


a = int(input())
b = list(input())
c = 0
d = 0
e = 0
while c + 1 < a:
	if b[c] == b[c + 1]:
		d = d + 1
	else:
		if d > 0:
			e = e + d
		d = 0
	c = c + 1
e = e + d
print(e)


(num, lst) = (input(), input())
print(sum([1 for i in range(len(lst) - 1) if lst[i] == lst[i + 1]]))


n = input()
stones = list(input())
count = 0
idx = 0
while True:
	try:
		if stones[idx] == stones[idx + 1]:
			del stones[idx + 1]
			count += 1
		else:
			idx += 1
	except:
		break
print(count)


n = int(input())
st = input()
st = 'A' + st
res = ''
for i in range(n):
	if not st[i] == st[i + 1]:
		res += st[i + 1]
print(len(st) - len(res) - 1)


n = int(input())
x = input()
color = x.upper()
count = 0
for i in range(0, n - 1):
	if color[i] == color[i + 1]:
		count += 1
print(count)


length = int(input())
txt = input()
c1 = 0
c2 = 0
c3 = 0
count = 0
for i in txt:
	if i == 'R':
		c1 += 1
		c2 = 0
		c3 = 0
	elif i == 'B':
		c2 += 1
		c1 = 0
		c3 = 0
	elif i == 'G':
		c3 += 1
		c1 = 0
		c2 = 0
	if c1 + c2 + c3 != 1:
		count += 1
print(count)


no_stones = int(input())
stones = input()
no_removed = 0
for i in range(len(stones) - 1):
	if stones[i] == stones[i + 1]:
		no_removed += 1
print(str(no_removed))


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


count = input()
stones = input()
removedStones = 0
for (index, stone) in enumerate(stones):
	if index + 1 < len(stones):
		nextStone = stones[index + 1]
		if nextStone == stone:
			removedStones += 1
print(removedStones)


def stonesOnTheTable(n, string):
	steps = 0
	for i in range(1, n):
		if string[i] == string[i - 1]:
			steps += 1
	return steps
n = int(input())
string = input()
if 1 <= n <= 50:
	print(stonesOnTheTable(n, string))
else:
	raise ValueError


n = int(input())
c = input()
if len(c) == n:
	co = 0
	i = 0
	while i < len(c) - 1:
		if c[i] == c[i + 1]:
			c = c[0:i] + c[i + 1:]
			co += 1
		else:
			i += 1
	print(co)


from sys import stdin, stdout
n = stdin.readline()
word = stdin.readline()
count = 1
length = ''
for i in range(1, len(word)):
	if word[i - 1] == word[i]:
		count += 1
out = str(count)
k = int(out) - 1
stdout.write(str(k))


def main():
	_ = input()
	stones = input()
	to_delete = 0
	idx = 0
	limit = len(stones) - 1
	while idx < limit:
		if stones[idx + 1] == stones[idx]:
			stones = stones[:idx + 1] + stones[idx + 2:]
			to_delete += 1
			limit -= 1
		else:
			idx += 1
	return to_delete
print(main())


n = int(input())
stroka = input()
vivod = 0
prediduchii = stroka[0]
i = 1
while i < n:
	if prediduchii == stroka[i]:
		vivod += 1
	prediduchii = stroka[i]
	i += 1
print(vivod)


x = int(input())
y = list(map(str, input()))
count = 0
for i in range(len(y) - 1):
	if y[i] == y[i + 1]:
		count += 1
print(count)


st = int(input())
tbl = input()
main = []
for i in tbl:
	main.append(i)
rep = 'a'
j = 0
count = 0
for i in range(st):
	if main[j] == rep:
		main.remove(main[j])
		count += 1
	else:
		rep = main[j]
		j += 1
print(count)


a = int(input(''))
b = input('')
c = ''
for i in range(1, a):
	if b[i - 1] == b[i]:
		c = c + b[i - 1]
print(len(c))


x = int(input())
lst = list(input())
count = 0
i = len(lst)
while i >= 2:
	if lst[0] == lst[1]:
		count += 1
	i -= 1
	lst.pop(0)
print(count)


def StonesOnTheTable():
	n = int(input())
	string = input()
	count = 0
	for i in range(n):
		try:
			if string[i] == string[i + 1]:
				string = string.replace(string[i], '-', 1)
				count += 1
		except:
			break
	print(count)
	return None

def main():
	StonesOnTheTable()
main()


n = int(input())
st = str(input())
count = 0
while st.find('RR') != -1:
	st = st.replace('RR', 'R', 1)
	count = count + 1
while st.find('GG') != -1:
	st = st.replace('GG', 'G', 1)
	count = count + 1
while st.find('BB') != -1:
	st = st.replace('BB', 'B', 1)
	count = count + 1
print(count)


n = int(input())
s = input()
prev_len = -1
orig_len = len(s)
while len(s) != prev_len:
	prev_len = len(s)
	s = s.replace('RR', 'R')
	s = s.replace('GG', 'G')
	s = s.replace('BB', 'B')
print(orig_len - len(s))


input()
stones = input()
color = 'N'
ctr = 0
for i in stones:
	if i == color:
		ctr += 1
	else:
		color = i
print(ctr)


q = int(input())
k = str(input())
c = 0
i = 0
while i < q - 1:
	if k[i] == k[i + 1]:
		c = c + 1
	i = i + 1
print(c)


import re
cnt = int(input())
L = input()
M = L
while re.search('RR', L):
	L = L.replace('RR', 'R')
while re.search('GG', L):
	L = L.replace('GG', 'G')
while re.search('BB', L):
	L = L.replace('BB', 'B')
m = len(M) - len(L)
print(m)


n = int(input())
l = input()
count = 0
for i in range(len(l)):
	try:
		if l[i] == l[i + 1]:
			count += 1
	except:
		break
print(count)


n = int(input())
stones = input()
c = 0
list_color_stones = []
for i in stones:
	list_color_stones.append(i)
for i in range(n - 1):
	if list_color_stones[i] == list_color_stones[i + 1]:
		c += 1
print(c)


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


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


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


v = int(input())
s = input('')
count = 0
for x in range(0, len(s) - 1):
	if s[x] == s[x + 1]:
		count += 1
print(count)


n = int(input())
c = input()
prev = ''
m = 0
for i in range(n):
	if c[i] == prev:
		m += 1
	prev = c[i]
print(m)


n = int(input())
stone = str(input())
current = 'Y'
remove = 0
for i in stone:
	if i != current:
		current = i
	else:
		remove += 1
print(remove)


length = int(input())
s = input()
res = []
for i in range(length):
	if i != length - 1:
		if s[i] == s[i + 1]:
			res.append(s[i])
print(len(res))


input()
s = input()
print(sum((x == y for (x, y) in zip(s, s[1:]))))


n = int(input())
x = list(input())
i = 0
sum = 0
while i < n - 1:
	if x[i] == x[i + 1]:
		i += 1
	else:
		i += 1
		sum += 1
print(n - (sum + 1))


input()
s = input()
c = 0
j = ''
for i in s:
	if j != i:
		j = i
	else:
		c += 1
print(c)


def main():
	n = int(input())
	ls = list(input())
	ctr = 0
	for i in range(n - 1):
		if ls[i] == ls[i + 1]:
			ctr += 1
	print(ctr)
main()


num_stones = int(input())
stones = input()
num_away = 0
for i in range(1, num_stones):
	if stones[i] == stones[i - 1]:
		num_away += 1
print(num_away)


n = int(input())
a = input()
print(sum((a[i] == a[i + 1] for i in range(0, n - 1))))


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


numbers = input()
colors = input()
counter = 0
for i in range(int(numbers)):
	if i == int(numbers) - 1:
		break
	elif colors[i] == colors[i + 1]:
		counter += 1
print(counter)


n = int(input())
line = input()
output = ''
prev = ''
for i in range(0, n):
	if line[i] != prev:
		output = output + line[i]
		prev = line[i]
print(len(line) - len(output))


input()
line = input().strip('\n\r\t ')
prev = None
remove = 0
for c in line:
	if c == prev:
		remove += 1
	prev = c
print(remove)


n = int(input())
stones = input()
last_seen = stones[0]
ans = 0
for i in range(1, n):
	if stones[i] == last_seen:
		ans += 1
	else:
		last_seen = stones[i]
print(ans)


a = int(input())
b = str(input())
c = len(b)
cnt = 0
for i in range(c - 1):
	if b[i] == b[i + 1]:
		cnt += 1
print(cnt)


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


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


n = int(input())
s = list(input())
i = 1
ans = 0
while i < len(s):
	if s[i] == s[i - 1]:
		s.pop(i)
		ans += 1
	else:
		i += 1
print(ans)


C = 0
N1 = int(input())
N = input()
for _ in range(N1 - 1):
	if N[_] == N[_ + 1]:
		C += 1
print(C)


from math import ceil
for _ in range(1):
	n = int(input())
	stones = list(input())
	i = 0
	total = 0
	while i < len(stones) - 1:
		if stones[i] == stones[i + 1]:
			stones.pop(i)
			total += 1
		else:
			i += 1
	print(total)


n = int(input())
a = str(input())
b = 0
if n > 1:
	for i in range(n - 1):
		if a[i] == a[i + 1]:
			b = b + 1
print(b)


n = eval(input())
l1 = list(input())
k = 0
for i in range(len(l1) - 1):
	if l1[i] == l1[i + 1]:
		k += 1
print(k)


from itertools import groupby
S = input()
ans = 0
for (name, group) in groupby(input()):
	ans += len(list(group)) - 1
print(ans)


def main():
	lineLen = input()
	line = input()
	print(sum((1 for i in range(1, len(line)) if line[i] == line[i - 1])))
main()


from sys import stdin
stdin.readline()
s = list(stdin.readline().rstrip())
res = 0
res = sum((1 for (a, b) in zip(s, s[1:]) if a == b))
print(res)


uselessNumber = input()
stones = list(input())
answer = 0
for i in range(0, len(stones) - 1):
	if stones[i] == stones[i + 1]:
		answer += 1
print(answer)


n = int(input(''))
char = str(input(''))
count = 0
for j in range(0, n - 1):
	if char[j] == char[j + 1]:
		count += 1
print(count)


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


n = int(input())
row = list(input())
colors = ['R', 'G', 'B']
check = True
s = 0
while check:
	a = 0
	r = len(row)
	if r > 1:
		for i in range(0, r - 1):
			if row[i] == row[i + 1]:
				row.pop(i)
				a += 1
				break
		s += a
	if a == 0:
		check = False
print(s)


n = input()
line = input()
count = 1
for i in range(len(line) - 1):
	if line[i] != line[i + 1]:
		count += 1
print(len(line) - count)


n = int(input())
str = list(input())

def solve(nP, strP):
	numb = 0
	pomC = strP[0]
	for x in range(1, len(strP)):
		if pomC == strP[x]:
			numb += 1
		else:
			pomC = strP[x]
	return numb
print(solve(n, str))


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


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


(seq, text, count) = (int(input()), input(), 0)
for i in range(seq - 1):
	if text[i] == text[i + 1]:
		count += 1
print(count)


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


n = input()
s = input()
count = 0
for i in s:
	s = s[s.index(i) + 1:]
	if len(s) > 0 and i == s[0]:
		count += 1
print(count)


x = int(input())
y = input()
num = 0
for i in range(0, x - 1):
	if y[i] == y[i + 1]:
		num += 1
	else:
		num += 0
print(num)


n = eval(input())
s = input()
c = 0
while n > 1:
	if s[n - 1] == s[n - 2]:
		c += 1
	n -= 1
print(c)


from sys import stdin
input = stdin.readline

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


long = int(input())
stones = []
rocks = input()
for i in rocks:
	stones.append(i)
cont = 0
for i in range(long - 1):
	if stones[i] == stones[i + 1]:
		cont += 1
print(cont)


n = int(input())
st = input()
lst = []
for i in st:
	lst.append(i)
lst2 = []
for i in range(n - 1):
	if lst[i] != lst[i + 1]:
		lst2.append(lst[i])
lst2.append(lst[n - 1])
print(len(lst) - len(lst2))


x = int(input())
name = input()
c = 0
for i in range(x - 1):
	if name[i] == name[i + 1]:
		c += 1
print(c)


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


x = int(input())
arr = list(map(str, input().split()))
lst = []
count = 0
for i in range(len(arr)):
	lst += arr[i]
for i in range(len(lst) - 1):
	if lst[i] == lst[i + 1]:
		count += 1
print(count)


n = int(input())
arr = list(input())
res = 0
i = 1
while i < len(arr):
	if arr[i] == arr[i - 1]:
		del arr[i]
		res += 1
	else:
		i += 1
print(res)


p = int(input())
k = input()
c = 0
for i in range(0, p - 1):
	if k[i] == k[i + 1]:
		c = c + 1
	else:
		c = c
print(c)


n = int(input())
s = input()
a = []
for i in s:
	a.append(i)
for i in range(n - 1, 0, -1):
	if a[i] == a[i - 1]:
		del a[i]
print(n - len(a))


def check_stones(stones):
	ele_prev = stones[0]
	c = 0
	for ele in stones[1:]:
		if ele == ele_prev:
			c += 1
		ele_prev = ele
	return c
n = int(input())
stones = input()
c = 0
l = check_stones(stones)
print(l)


a = int(input())
b = input()
d = len(b)
while 'RR' in b:
	c = b.replace('RR', 'R')
	b = c
while 'GG' in b:
	c = b.replace('GG', 'G')
	b = c
while 'BB' in b:
	c = b.replace('BB', 'B')
	b = c
e = len(b)
print(d - e)


n = int(input())
l = input()
count = 0
i = 0
while i < n - 1:
	for j in range(i + 1, n):
		if l[i] == l[j] and j != n - 1:
			count += 1
		if l[i] == l[j] and j == n - 1:
			count += 1
			i = j
			break
		if l[i] != l[j]:
			i = j
			break
print(count)


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


import sys

class Scanner:

	def __init__(self):
		self.current_tokens = []

	def remaining_tokens(self):
		return len(self.current_tokens)

	def nextline(self):
		assert self.remaining_tokens() == 0, 'Reading next line with remaining tokens'
		return input()

	def nexttokens(self):
		return self.nextline().split()

	def nexttoken(self):
		if len(self.current_tokens) == 0:
			self.current_tokens = self.nexttokens()
		assert self.remaining_tokens() > 0, 'Not enough tokens to parse.'
		return self.current_tokens.pop(0)

	def nextints(self, n=-1):
		if n == -1:
			return list(map(int, self.nexttokens()))
		else:
			return (self.nextint() for i in range(n))

	def nextint(self):
		return int(self.nexttoken())

def quit():
	sys.exit(0)
stdin = Scanner()
nextint = stdin.nextint
nextints = stdin.nextints
nextline = stdin.nextline
n = nextint()
w = nextline()
r = 0
for i in range(len(w) - 1):
	if w[i] == w[i + 1]:
		r += 1
print(r)


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


def main():
	number_stones = int(input())
	raw_stones = input()
	final_stones = raw_stones[0]
	for i in range(1, number_stones):
		if not final_stones.endswith(raw_stones[i]):
			final_stones += raw_stones[i]
	difference = len(raw_stones) - len(final_stones)
	print(str(difference))
main()


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


def main():
	inp = int(input())
	inp1 = input()
	c = 0
	for i in range(1, inp):
		if inp1[i] == inp1[i - 1]:
			c += 1
	print(c)
main()


n = int(input())
stones = list(input())
to_drop = []
for i in range(len(stones) - 1):
	if stones[i] == stones[i + 1]:
		to_drop.append(i)
print(len(to_drop))


n = int(input())
a = str(input())
t = 1
te = []
for i in range(1, len(a)):
	if a[i] == a[i - 1]:
		t += 1
	else:
		te.append(t - 1)
		t = 1
te.append(t - 1)
print(sum(te))


input()
colors = input()
counter = 0
for i in range(len(colors) - 1):
	if colors[i] == colors[i + 1]:
		counter += 1
print(counter)


length = int(input())
stones = input()
i = 0
changes = 0
while i < length - 1:
	if stones[i] == stones[i + 1]:
		changes += 1
		i += 1
		continue
	else:
		i += 1
		continue
print(changes)


from itertools import groupby
t = input()
s = input()
ans = len(s) - len([i for (i, x) in groupby(list(s))])
print(ans)


import sys
n = int(input())
s = str(input())
i = 1
ans = s[0]
while i < len(s):
	if s[i - 1] == s[i]:
		i += 1
	else:
		ans = ans + s[i]
		i += 1
print(len(s) - len(ans))


from collections import deque, Counter
import array
from itertools import combinations, permutations
from math import sqrt
import unittest

def read_int():
	return int(input().strip())

def read_int_array():
	return [int(i) for i in input().strip().split(' ')]
n = read_int()
s = input().strip()
count = 0
i = 0
for j in range(1, n):
	if s[i] == s[j]:
		count += 1
	else:
		i = j
print(count)


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


a = int(input())
x = list(map(str, input()))
y = x[0]
g = 0
for i in x[1:]:
	if y == i:
		g += 1
	y = i
print(g)


l = int(input())
n = str(input())
k = 0
if set(n) == 'R' or set(n) == 'B' or set(n) == 'G':
	print(l)
else:
	for i in range(0, l - 1):
		if n[i] == n[i + 1]:
			k += 1
	print(k)


input()
x = list(input())
count = 0
for i in range(len(x) - 1):
	if x[i] == x[i + 1]:
		count += 1
print(count)


n = int(input())
x = input()
key = x[0]
arr = [key]
for i in range(1, n):
	if key != x[i]:
		arr.append(x[i])
		key = x[i]
	else:
		pass
print(len(x) - len(arr))


num = int(input(''))
color = input('')
s = 0
for i in range(num - 1):
	if color[i] == color[i + 1]:
		s += 1
print(s)


n = int(input())
str = list(input())
cnt = 0
for i in range(len(str) - 1):
	if str[i] == str[i + 1]:
		cnt += 1
print(cnt)


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


n = int(input())
stones = input()
aux = 'a'
cont = 0
for i in stones:
	if i == aux:
		cont += 1
	else:
		aux = i
print(cont)


n = input()
s = input()
o = 0
k = ''
for i in s:
	if k == i:
		o += 1
	else:
		k = i
print(o)


n = int(input())
a = str(input())
i = 0
x = 0
while i < n:
	y = x
	for j in range(i + 1, n):
		if a[j] == a[i]:
			x += 1
		else:
			break
	i = i + 1 + x - y
print(x)


stone_list = []
t = int(input())
stones = input()
for character in stones:
	stone_list.append(character)
active = True
deletes = 0
i = 0
while active and i < len(stone_list) - 1:
	if stone_list[i] == stone_list[i + 1]:
		deletes += 1
		del stone_list[i]
	else:
		i += 1
print(deletes)


N = int(input())
l = list(input())
k = 0
for i in range(1, N):
	while l[i] == l[i - 1]:
		l[i - 1] = '0'
		k += 1
print(k)


from itertools import groupby
N = int(input())
Batee5a = input()
print(N - len(list(groupby(Batee5a))))


n = int(input())
lst1 = list(input())
a = i = 0
while i <= len(lst1) - 2:
	if lst1[i] == lst1[i + 1]:
		a += 1
	i += 1
print(a)


num = int(input())
colour = list(input())
sum = 0
for i in range(num - 1):
	if colour[i] == colour[i + 1]:
		sum += 1
print(sum)


a = int(input())
b = list(input())
print(sum([1 for i in range(a - 1) if b[i] == b[i + 1]]))


def main():
	n = int(input())
	rocks = input()
	count = 0
	for i in range(0, len(rocks) - 1):
		if rocks[i] == rocks[i + 1]:
			count += 1
	print(count)
main()


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


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
		elif colors[i] == colors[i + 1]:
			removed += 1
	print(removed)
stones()


n = int(input())
string = input()
listStr = list(string)
lenn = len(string)
i = 0
j = i + 1
count = 0
while j < lenn:
	if listStr[i] == listStr[j]:
		count = count + 1
	i = i + 1
	j = i + 1
print(count)


def color(n, l):
	c = 0
	for i in range(0, n - 1):
		if l[i] == l[i + 1]:
			c += 1
	return c
n = int(input())
l = input()
print(color(n, l))


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


(n, s) = (int(input()), input())
(z, c) = (0, 0)
for i in s:
	z += 1
	if z < len(s):
		if i == s[z]:
			c += 1
print(c)


input()
count = 0
stones = input()
for i in range(len(stones)):
	while len(stones) > i + 1 and stones[i] == stones[i + 1]:
		stones = stones[:i] + stones[i + 1:]
		count += 1
print(count)


number = int(input())
st = str(input())
res = 0
for i in range(number - 1):
	if st[i] == st[i + 1]:
		res += 1
print(res)


def main():
	r = p = 0
	input()
	for n in input():
		r += n == p
		p = n
	print(r)
main()


a = input()
a = input()
last = a[0]
delete = 0
for i in range(1, len(a)):
	if a[i] == last:
		delete += 1
	last = a[i]
print(delete)


n = int(input())
x = input()
a = []
for i in x:
	a.append(i)
t = 0
for i in range(n):
	if i == n - 1:
		break
	u = a[i]
	if a[i + 1] == a[i]:
		t += 1
print(t)


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


input()
s = input()
c = 0
for i in range(len(s) - 1):
	if s[i] != s[i + 1]:
		continue
	else:
		c = c + 1
print(c)


aantal = int(input())
combinatie = input()
AantalAanElkaar = 0
for i in range(1, aantal):
	if combinatie[i] == combinatie[i - 1]:
		AantalAanElkaar += 1
print(AantalAanElkaar)


num_stone = input()
color_stone = input()
s = 0
for i in range(len(color_stone)):
	try:
		if color_stone[i:i + 2] == 'RR':
			s += 1
		elif color_stone[i:i + 2] == 'GG':
			s += 1
		elif color_stone[i:i + 2] == 'BB':
			s += 1
		else:
			s += 0
	except IndexError:
		pass
print(s)


def fun(s):
	last = 0
	for i in range(1, len(s)):
		if s[i] == s[last]:
			s[i] = '0'
		else:
			last = i
	res = [i for i in s if i != '0']
	if len(res) == 1:
		return len(s) - 1
	return len(s) - len(res)
n = int(input())
s = list(input())
print(fun(s))


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


initial = int(input())
previous = None
for i in input():
	if i != previous:
		initial -= 1
	previous = i
print(initial)


a = int(input())
b = input()
flag = 0
for c in range(len(b) - 1):
	if b[c] == b[c + 1]:
		flag += 1
print(flag)


t = int(input())
a = list(str(input()))
count = 0
for i in range(t - 1):
	if a[i] == a[i + 1]:
		count += 1
print(count)


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


n = int(input())
a = list(input())
otvet = 0
for i in range(len(a) - 1):
	if a[i] == a[i + 1]:
		a.insert(i + 1, 0)
		otvet += 1
		a.remove(0)
print(otvet)


import sys

def rl():
	return sys.stdin.readline().strip()

def rn():
	return list(map(int, sys.stdin.readline().strip().split()))

def ri():
	return map(int, sys.stdin.readline().strip().split())

def rln(n):
	l = [None] * n
	for i in range(n):
		l[i] = int(rl())
	return l
n = int(input())
tab = input()
cnt = 0
for i in range(1, n):
	if tab[i] == tab[i - 1]:
		cnt += 1
print(cnt)


N = int(input())
S = list(input())
changes = 0
last = S[0]
for i in range(1, N):
	if last != S[i]:
		changes += 1
	last = S[i]
print(N - (changes + 1))


def stonesOnTable():
	count = 0
	n = int(input())
	values = list(input())
	for i in range(len(values) - 1):
		if values[i] == values[i + 1]:
			count += 1
	print(count)
stonesOnTable()


n = input()
s = input()
c = 0
a = s[0]
for e in s[1:]:
	if e == a:
		c += 1
	a = e
print(c)


w = int(input())
c = input()
(v, mm, n) = (0, 0, 0)
for i in range(len(c) - 1):
	if c[i] == c[i + 1]:
		v += 1
print(v)


def getMinimumStone():
	numOfStones = int(input())
	stones = [x for x in input()]
	count = 0
	if len(stones) == 1:
		return count
	else:
		for i in range(len(stones) - 1):
			if stones[i] == stones[i + 1]:
				count += 1
		return count
print(getMinimumStone())


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


def reapeter(tries, rocks):
	changes = 0
	for i in range(1, tries):
		if rocks[i] == rocks[i - 1]:
			changes += 1
	return changes
tries = int(input())
rocks = input()
print(reapeter(tries, rocks))


int1 = int(input())
str1 = input()
answer = 0
for i in range(len(str1)):
	try:
		if str1[i] == str1[i + 1]:
			answer += 1
	except IndexError:
		continue
print(answer)


def function(s):
	l = list(s)
	total = 0
	for i in range(0, len(l) - 1):
		if l[i] == l[i + 1]:
			total += 1
	print(total)
n1 = input()
n = int(n1)
s = input()
function(s)


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


import sys
import math
import os
import itertools
import string
import heapq
import _collections
from collections import Counter
from collections import defaultdict
from functools import lru_cache
import bisect
import re
import queue
from decimal import *

class Scanner:

	@staticmethod
	def int():
		return int(sys.stdin.readline().rstrip())

	@staticmethod
	def string():
		return sys.stdin.readline().rstrip()

	@staticmethod
	def map_int():
		return [int(x) for x in Scanner.string().split()]

	@staticmethod
	def string_list(n):
		return [input() for i in range(n)]

	@staticmethod
	def int_list_list(n):
		return [Scanner.map_int() for i in range(n)]

	@staticmethod
	def int_cols_list(n):
		return [int(input()) for i in range(n)]

class Math:

	@staticmethod
	def gcd(a, b):
		if b == 0:
			return a
		return Math.gcd(b, a % b)

	@staticmethod
	def lcm(a, b):
		return a * b // Math.gcd(a, b)

	@staticmethod
	def divisor(n):
		res = []
		i = 1
		for i in range(1, int(n ** 0.5) + 1):
			if n % i == 0:
				res.append(i)
				if i != n // i:
					res.append(n // i)
		return res

	@staticmethod
	def round_up(a, b):
		return -(-a // b)

	@staticmethod
	def is_prime(n):
		if n < 2:
			return False
		if n == 2:
			return True
		if n % 2 == 0:
			return False
		d = int(n ** 0.5) + 1
		for i in range(3, d + 1, 2):
			if n % i == 0:
				return False
		return True

def pop_count(x):
	x = x - (x >> 1 & 6148914691236517205)
	x = (x & 3689348814741910323) + (x >> 2 & 3689348814741910323)
	x = x + (x >> 4) & 1085102592571150095
	x = x + (x >> 8)
	x = x + (x >> 16)
	x = x + (x >> 32)
	return x & 127
MOD = int(1000000000.0) + 7
INF = int(1000000000000000.0)

def solve():
	N = Scanner.int()
	S = Scanner.string()
	ans = 0
	for i in range(1, N):
		if S[i - 1] == S[i]:
			ans += 1
	print(ans)

def main():
	solve()
main()


r = int(input())
string = input()
r1 = 0
for i in range(r - 1):
	if string[i] == string[i + 1]:
		r1 += 1
print(r1)


x = input()
y = input()
kk = []
i = 0
while i < len(y):
	kk.append(y[i])
	i += 1
l = 0
while l < len(kk) - 1:
	r = l + 1
	if kk[r] == kk[l]:
		kk.pop(r)
	else:
		l += 1
print(len(y) - len(kk))


def solve(n, stones):
	changes = 0
	for i in range(1, n):
		if stones[i] == stones[i - 1]:
			changes += 1
	return changes
n = int(input())
s = str(input())
print(solve(n, s))


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


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


input()
stones = []
for stone in input():
	stones.append(stone)
last = ''
counter = 0
for stone in stones:
	if stone == last:
		counter += 1
	else:
		last = stone
print(counter)


n = int(input())
string = input()
count = 0
for x in range(n):
	if x != 0:
		if string[x] == string[x - 1]:
			count += 1
print(count)


count = int(input())
colors = input()
c = 0
if count == 0:
	print(0)
else:
	for i in range(count - 1):
		if colors[i + 1] == colors[i]:
			c += 1
print(c)


def ecolor():
	n = int(input())
	s = input()
	i = 0
	c = 0
	if len(s) == 1:
		print('0')
	else:
		while True:
			if s[i] == s[i + 1]:
				c += 1
			if i == n - 2:
				break
			i += 1
		print(c)
ecolor()


def readis():
	return map(int, input().strip().split())

def printlist(xs):
	print(' '.join(map(str, xs)))
n = int(input())
s = input()
cs = []
last = None
for c in s:
	if c == last:
		cs[-1] += 1
	else:
		cs.append(0)
		last = c
print(sum(cs))


n = int(input())
s = str(input())
a = 1
x = BI = ER = GI = 0
while a < n:
	if s[a] == s[a - 1] and s[a] == 'B':
		BI = BI + 1
	if s[a] == s[a - 1] and s[a] == 'R':
		ER = ER + 1
	if s[a] == s[a - 1] and s[a] == 'G':
		GI = GI + 1
	a += 1
x = BI + GI + ER
print(x)


a = int(input())
b = str(input())
i = 0
j = 1
count = 0
while i < a - 1 and j < a:
	if b[i] == b[j]:
		count = count + 1
		j = j + 1
	else:
		j = j + 1
		i = j - 1
print(count)


length = int(input())
word = input()
count = 0
for letter in range(len(word)):
	if letter == len(word) - 1:
		break
	if word[letter] == word[letter + 1]:
		count += 1
print(count)


def Sol(st):
	actuel = st[0]
	count = 0
	for i in range(1, len(st)):
		if st[i] == actuel:
			count += 1
		else:
			actuel = st[i]
	return count
n = int(input())
print(Sol(input()))


n = int(input())
s = input()
s = s + 'X'
x = s[0]
c = 1
y = []
for i in range(1, n + 1):
	if s[i] == x:
		c += 1
	else:
		x = s[i]
		y.append(c - 1)
		c = 1
print(sum(y))


import sys
s = sys.stdin.read()
s = s.split('\n')
i = 0
for x in range(0, len(s[1]) - 1):
	if s[1][x] == s[1][x + 1]:
		i += 1
print(i)


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


def col(str):
	count = 0
	for i in range(len(str)):
		if i + 1 < len(str):
			if str[i] == str[i + 1]:
				strr = ''
				newstr1 = str[i + 1:len(str)]
				newstr2 = str[0:i]
				strr = strr + newstr1 + newstr2
				count = count + 1
	return count
n = input()
str = input()
ans = col(str)
print(ans)


number = int(input())
stones = input()
ncount = 0
stone = 0
while stone <= number - 2:
	if stones[stone] == stones[stone + 1]:
		ncount = ncount + 1
	stone = stone + 1
print(ncount)


a = int(input())
l = input()
c = l[0]
num = 0
for i in range(1, a):
	if l[i] == c:
		num += 1
	c = l[i]
print(num)


n = int(input())
s = list(input())
k = 0
for i in range(n):
	if n == 1:
		break
	if s[i] != s[i + 1]:
		pass
	else:
		k += 1
	if i + 2 == n:
		break
print(k)


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


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


from functools import reduce
import os
import sys
from math import *
from collections import *
from fractions import *
from bisect import *
from heapq import *
from io import BytesIO, IOBase
input = lambda : sys.stdin.readline().rstrip('\r\n')

def value():
	return tuple(map(int, input().split()))

def arr():
	return [int(i) for i in input().split()]

def sarr():
	return [int(i) for i in input()]

def inn():
	return int(input())
mo = 1000000007
n = inn()
s = input()
i = 0
ans = 0
while i < n:
	c = i
	res = s[i]
	while i < n and s[i] == res:
		i += 1
	ans += i - c - 1
print(ans)


(X, A) = (int(input()), 0)
(S, L) = (str(input()), [])
for char in range(len(S)):
	L.append(S[char])
for i in range(0, X - 1):
	if L[i] == L[i + 1]:
		A += 1
print(f'{A}')


x = int(input())
cont = 0
l = input()
for i in range(0, x):
	if i < x - 1:
		if l[i] == l[i + 1]:
			cont = cont + 1
print(cont)


input()
s = input()
ans = 0
for f in range(len(s) - 1):
	if s[f] == s[f + 1]:
		ans += 1
print(ans)


num = int(input())
stones = input()
n = 0
cant = 1
while n < num:
	if n >= 1:
		if stones[n] == stones[n - 1]:
			cant = cant + 1
	n = n + 1
print(cant - 1)


input()
p = 'N'
k = 0
for i in input():
	if p == i:
		k += 1
	p = i
print(k)


num_stones = int(input())
sequence = input()
alt_counter = 1
index = 0
if_count = 0
else_count = 0
while index < num_stones - 1:
	if sequence[index] != sequence[index + 1]:
		alt_counter = alt_counter + 1
	index = index + 1
print(num_stones - alt_counter)


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


kind = ['RR', 'GG', 'BB']
n = int(input())
s = input()
ans = 0
for i in range(n):
	ans += s[i:i + 2] in kind
print(ans)


import sys
n = input()
array = input()
count = 0
prev = 'adfasd'
for a in range(len(array)):
	if prev == array[a]:
		count += 1
	prev = array[a]
print(count)


n = int(input())
m = input()
k = 0
while True:
	if m == '':
		break
	else:
		y = 0
		for s in range(len(m)):
			if m[s] == m[0]:
				y += 1
			else:
				break
		k += y - 1
		m = m[y:]
print(k)


a = int(input())
b = list(input())
count = 0
while True:
	for i in range(1, len(b)):
		if b[i] == b[i - 1]:
			del b[i]
			count += 1
			break
	else:
		break
print(count)


jml = int(input(''))
baris = [i for i in input('')]
count = 0
if jml == 1:
	print(0)
else:
	for i in range(jml - 1):
		if baris[i] == baris[i + 1]:
			count += 1
		else:
			continue
	print(count)


n = int(input())
s = list(map(str, input()))
s.append(' ')
c = 0
for i in range(n):
	if s[i] == s[i + 1]:
		c = c + 1
print(c)


leng = int(input())
cnt = 0
string = input()
for i in range(leng - 1):
	if string[i] == string[i + 1]:
		cnt += 1
print(cnt)


n = int(input())
c = input()
count = 0
for i in range(len(c)):
	if c[i:].startswith('RR') or c[i:].startswith('GG') or c[i:].startswith('BB'):
		count += 1
print(count)


a = int(input())
b = input()
l = []
for x in range(a):
	l.append(b[x])
c = l[0]
n = 0
for x in range(1, a):
	if l[x] == c:
		n = n + 1
	else:
		c = l[x]
print(n)


count = int(input())
colors = [x for x in input()]
i = 0
deleted = 0
buf = colors[i]
i += 1
while i < count:
	if colors[i] == buf:
		deleted += 1
	else:
		buf = colors[i]
	i += 1
print(deleted)


no_of_stones = int(input())
s = list(input())
count_r = 0
count_g = 0
count_b = 0
for i in range(len(s) - 1):
	if s[i] == 'R' and s[i + 1] == 'R':
		count_r += 1
for i in range(len(s) - 1):
	if s[i] == 'G' and s[i + 1] == 'G':
		count_g += 1
for i in range(len(s) - 1):
	if s[i] == 'B' and s[i + 1] == 'B':
		count_b += 1
print(count_r + count_b + count_g)


def stones():
	n = int(input())
	stones = list(input().strip())
	let = {'R': True, 'B': True, 'G': True}
	k = 0
	for i in range(1, len(stones)):
		if stones[i - 1] == stones[i]:
			k += 1
	return k
print(stones())


import re
n = int(input())
s = input()
c = ''
cnt = 0
for i in range(n):
	if c == s[i]:
		cnt += 1
	c = s[i]
print(cnt)


numofstones = input()
colours = input()
lll = list()
for c in colours:
	lll.append(c)
indextoremove = list()
count = 0
for letter in lll[:-1]:
	if lll[lll.index(letter, count) + 1] == letter:
		if lll[lll.index(letter, count) + 1] not in indextoremove:
			indextoremove.append(lll.index(letter, count))
	count += 1
print(len(indextoremove))


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


n = int(input())
s = input()
gg = 0
bb = 0
rr = 0
for i in range(n):
	k = s[i:i + 2]
	if k == 'RR':
		rr = rr + 1
	if k == 'GG':
		gg = gg + 1
	if k == 'BB':
		bb = bb + 1
x = rr + bb + gg
print(x)


x = int(input())
y = input()
v = 0
for i in range(1, x):
	v = v + (y[i] == y[i - 1])
print(v)


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


z = int(input())
n = input()
m = list(n)
c = 0
for i in range(z - 1):
	if m[i] == m[i + 1]:
		c = c + 1
print(c)


len = input()
w = input()
col = True
c = 0
newW = w
while col:
	col = False
	w = newW
	newW = w[0]
	lCh = newW
	for ch in w[1:]:
		if ch == lCh:
			c += 1
			col = True
		else:
			newW += ch
		lCh = ch
print(c)


s = input()
s = input()
ans = 0
curr = '-'
for x in s:
	if x == curr:
		ans += 1
	else:
		curr = x
print(ans)


n = int(input(''))
string = list(input(''))
count = 0
for i in range(n):
	try:
		if string[i + 1] == string[i]:
			count += 1
		else:
			continue
	except:
		break
print(count)


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


n = int(input())
str = input()
result = 0
for (x, y) in zip(str, str[1:]):
	if x == y:
		result += 1
print(result)


x = int(input())
y = str(input())
a = 0
for i in range(1, x):
	if y[i] == y[i - 1]:
		a = a + 1
print(a)


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


a = int(input())
a = input()
count = 0
for i in range(0, len(a) - 1):
	if a[i] == a[i + 1]:
		a.replace(a[i + 1], '')
		count += 1
print(count)


m = int(input())
n = input()
kol = 0
while 'RR' in n:
	n = n.replace('RR', 'R', 1)
	kol += 1
while 'BB' in n:
	n = n.replace('BB', 'B', 1)
	kol += 1
while 'GG' in n:
	n = n.replace('GG', 'G', 1)
	kol += 1
print(kol)


n = int(input())
l = input()
c = l[0]
for i in range(1, n):
	m = l[i]
	if m == l[i - 1]:
		continue
	else:
		c = c + m
d = len(l) - len(c)
print(int(d))


n = int(input())
stones = [char for char in input()]
length = len(stones)
min = 0
fast = 1
slow = 0
while fast < length and slow < length:
	if stones[slow] != stones[fast]:
		slow = fast
		fast += 1
	else:
		fast += 1
		min += 1
print(min)


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


n = int(input())
curr = ''
count = 0
run = 0
for c in input():
	if curr != c:
		count += max(0, run - 1)
		run = 0
		curr = c
	run += 1
print(count + max(0, run - 1))


b = int(input())
c = 0
a = input()
for i in range(b - 1):
	if a[i] == 'R' and a[i + 1] == 'R':
		c = c + 1
	elif a[i] == 'G' and a[i + 1] == 'G':
		c = c + 1
	elif a[i] == 'B' and a[i + 1] == 'B':
		c = c + 1
print(c)


n = int(input())
s = input()
count = 0
flag = False
while flag == False:
	flag = True
	for i in range(1, len(s)):
		if s[i] == s[i - 1] and i != len(s) - 1:
			flag = False
			count += 1
			s = s[:i] + s[i + 1:]
			break
		elif s[i] == s[i - 1]:
			flag = False
			count += 1
			s = s[:i]
			break
print(count)


a = int(input())
b = list(input())
c = len(b) - 1
i = 0
x = 0
remove = 0
while i < a - 1:
	if b[x] == b[x + 1]:
		remove += 1
	x += 1
	i += 1
print(remove)


lines = []
while True:
	try:
		lines.append(input())
	except EOFError:
		break
number_of_stones = int(lines[0])
colour_sequence = lines[1]
count = 0
for x in range(0, number_of_stones - 1):
	if colour_sequence[x] == colour_sequence[x + 1]:
		count = count + 1
print(count)


input()
s = list(input())
ans = []
counter = 0
for i in range(len(s) - 1):
	if s[i] == s[i + 1]:
		counter += 1
	else:
		ans.append(s[i + 1])
print(counter)


n = int(input())
colours = input()
count = 0
previous_colour = colours[0]
for colour in colours[1:]:
	if colour == previous_colour:
		count += 1
	previous_colour = colour
print(count)


import re
n = input()
s = input()
count = 0
for i in range(int(n) - 1):
	if s[i] == 'R' and s[i + 1] == 'R':
		count = count + 1
	if s[i] == 'G' and s[i + 1] == 'G':
		count = count + 1
	if s[i] == 'B' and s[i + 1] == 'B':
		count = count + 1
print(count)


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


def split(word):
	return [char for char in word]
x = input()
x = int(x)
L = split(input())
L.append('X')
CH = 0
temp = L[0]
for i in range(1, x):
	if temp != L[i]:
		CH = CH + 1
		temp = L[i]
print(x - CH - 1)


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


n = int(input())
str1 = input()
s = []
m = 0
for i in str1:
	if not s or s[-1] != i:
		s.append(i)
	else:
		m += 1
print(m)


n = int(input())
l1 = list(input())
c = 0
for i in range(len(l1) - 1):
	if l1[i] == l1[i + 1]:
		c += 1
print(c)


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


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


s = [list(input()) for i in range(2)][1]
a = [s[0]]
for i in range(1, len(s)):
	if s[i] != s[i - 1]:
		a.append(s[i])
print(len(s) - len(a))


num = int(input())
stones = input()
n = len(stones)
res = 0
for i in range(n - 1):
	if stones[i] == stones[i + 1]:
		res += 1
print(str(res))


n = int(input())
l = input()
nCount = 0
p = l[0]
for i in range(1, n):
	if l[i] == p:
		nCount += 1
	else:
		p = l[i]
print(nCount)


no = int(input())
string = input()
p = string[0]
i = 1
count = 0
while i < len(string):
	if string[i] == p:
		count += 1
	else:
		p = string[i]
	i += 1
print(count)


n = int(input())
s = input()
k = len(s)
for x in ['R', 'G', 'B']:
	while s != s.replace(x * 2, x):
		s = s.replace(x * 2, x)
print(k - len(s))


n = int(input())
s = input().rstrip()
x = list(s)
if len(x) == 1:
	print(0)
elif len(set(x)) == 1:
	print(len(x) - 1)
elif len(x) == 2:
	print(0)
else:
	a = 0
	while 1:
		T = 0
		for i in range(0, len(x) - 1):
			if x[i] == x[i + 1]:
				del x[i]
				a += 1
				break
			else:
				T += 1
		if T == len(x) - 1:
			break
	print(a)


try:
	n = int(input())
	S = input()
	count = 0
	for i in range(0, n - 1):
		if S[i] == S[i + 1]:
			count += 1
	print(count)
except:
	pass


num = int(input())
strList = input()
counter = 0
for i in range(num - 1):
	if strList[i] == strList[i + 1]:
		counter += 1
if counter == num - 1:
	print(num - 1)
else:
	print(counter)


n = int(input())
string = input()
count = 0
list1 = list(string)
for i in range(len(list1) - 1):
	if list1[i] == list1[i + 1]:
		count += 1
print(count)


N = int(input())
A = input()
B = [A[0]]
b = A[0]
for i in range(1, N):
	if A[i] == b:
		pass
	else:
		B.append(A[i])
		b = A[i]
n = len(B)
print(int(N - n))


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


num_stones = int(input())
stone_type = input()
same = 0
prev = ''
for color in stone_type:
	if prev == color:
		same = same + 1
	else:
		prev = color
print(same)


useless_var = input()
seq = input()
new_seq = seq[0]
for stone in seq:
	if stone != new_seq[-1]:
		new_seq += stone
print(len(seq) - len(new_seq))


t = int(input())
rocks = input()
last_rock = rocks[0]
counter = 0
for i in range(1, t):
	rock = rocks[i]
	if rock == last_rock:
		counter += 1
	last_rock = rock
print(counter)


n = int(input())
p = 0
s = input()
s = list(s)
i = 0
while i < len(s) - 1:
	if len(s) > 1:
		if s[i] == s[i + 1]:
			del s[i]
			p += 1
		else:
			i += 1
	else:
		break
print(p)


def calculate(ar):
	cnt = 0
	i = 0
	while i < len(ar) - 1:
		if ar[i] == ar[i + 1]:
			cnt += 1
		i += 1
	return cnt
n = int(input())
str = input()
print(calculate(list(str)))


n = int(input())
s = input()
p = ' '
c = 0
for i in range(n):
	if s[i] == p:
		c = c + 1
	else:
		p = s[i]
p = ' '
c2 = 0
for i in range(n - 1, -1, -1):
	if s[i] == p:
		c2 = c2 + 1
	else:
		p = s[i]
print(min(c, c2))


x = int(input())
st_clr = input()
st_clr.split()
q = 0
r = 0
for i in range(x - 1):
	if st_clr[i] == st_clr[i + 1]:
		r = r + 1
	else:
		continue
print(r)


n = int(input())
s = input()
count = 0
for i in range(0, n - 1):
	if s[i] == 'R' and s[i + 1] == 'R':
		count = count + 1
	elif s[i] == 'B' and s[i + 1] == 'B':
		count = count + 1
	elif s[i] == 'G' and s[i + 1] == 'G':
		count = count + 1
	else:
		continue
print(count)


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


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


n = input
n()
s = n()
print(sum((i == j for (i, j) in zip(s[1:], s))))


from sys import stdin
n = int(stdin.readline().strip())
s = stdin.readline().strip()
number = 0
for i in range(n - 1):
	if s[i] == s[i + 1]:
		number += 1
print(number)


n = int(input())
ln = input()
print(sum((ln[i] == ln[i - 1] for i in range(1, n))))


n = int(input())
row = input()
a = 0
ris = 0
while a < len(row) - 1:
	if row[a] != row[a + 1]:
		a += 1
	else:
		row = row[0:a] + row[a + 1:]
		ris += 1
print(ris)


ln = int(input())
strg = str(input())
changes = 0
for i in range(1, ln):
	if strg[i] == strg[i - 1]:
		changes += 1
print(changes)


n = int(input())
stones = input()
regions = []
curr = 0
for i in range(len(stones)):
	if i == 0 or stones[i] == stones[i - 1]:
		curr += 1
	else:
		regions.append(curr)
		curr = 1
regions.append(curr)
total = 0
for length in regions:
	total += length - 1
print(total)


n = input()
a = list(input())
print(sum((i == j for (i, j) in zip(a, a[1:]))))


n = int(input())
s = input()
i = 0
res = 0
while i < n:
	j = i
	while j < n and s[j] == s[i]:
		j = j + 1
	j = j - 1
	res += j - i
	i = j + 1
print(res)


rangeo = int(input())
charson = input()
counter = 0
for i in range(rangeo):
	if i != len(charson) - 1:
		if charson[i] == charson[i + 1]:
			counter += 1
print(counter)


n = int(input())
s = input()
v = []
w = []
d = []
for i in range(0, n):
	if s[i] == 'R':
		v.append(i)
	if s[i] == 'B':
		w.append(i)
	if s[i] == 'G':
		d.append(i)

def f(x):
	if x > 1:
		return 0
	else:
		return 1

def c(x):
	s = 0
	for i in range(len(x) - 1):
		s = s + f(x[i + 1] - x[i])
	return s
a = c(v) + c(w) + c(d)
print(a)


n = int(input())
s = input()
rezult = 0
b = True
while b:
	if s.find('RR') != -1:
		s = s[:s.find('RR')] + 'R' + s[s.find('RR') + 2:]
		rezult += 1
	if s.find('GG') != -1:
		s = s[:s.find('GG')] + 'G' + s[s.find('GG') + 2:]
		rezult += 1
	if s.find('BB') != -1:
		s = s[:s.find('BB')] + 'B' + s[s.find('BB') + 2:]
		rezult += 1
	if s.find('RR') == -1 and s.find('GG') == -1 and (s.find('BB') == -1):
		b = False
print(rezult)


import sys
n = int(input())
s = sys.stdin.read(n)
counter = 0
for i in range(len(s) - 1):
	if s[i] == s[i + 1]:
		counter += 1
print(counter)


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


import sys
input = sys.stdin.readline
n = int(input())
stones = input()
stonesToBeTaken = 0
temp = 'a'
for i in range(0, n - 1):
	if stones[i] == stones[i + 1]:
		stonesToBeTaken += 1
print(stonesToBeTaken)


n = int(input())
rem = 0
ord = input()
for i in range(len(ord)):
	if 'BB' in ord[i:i + 2] or 'GG' in ord[i:i + 2] or 'RR' in ord[i:i + 2]:
		rem += 1
print(rem)


import sys
import re
s = sys.stdin.read().split('\n')[1]
print(len(s) - len(re.sub('([BGR])\\1+', '\\1', s)))


n = int(input())
stones = input()
stoneList = []
for stone in stones:
	stoneList.append(stone)

def sott(stoneList, a):
	i = 0
	for stone in stoneList:
		if i < len(stoneList) - 1:
			if stoneList[i] == stoneList[i + 1]:
				a += 1
				del stoneList[i]
				return sott(stoneList, a)
		i += 1
	return a
a = 0
print(sott(stoneList, a))


Output = 0
N = int(input())
Colours = input()
for i in range(N - 1):
	if Colours[i] == Colours[i + 1]:
		Output = Output + 1
print(Output)


a = int(input())
l = list(input())
x = 0
for i in range(0, len(l) - 1):
	if l[i] == l[i + 1]:
		x += 1
print(x)


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


n = int(input())
pattern = input()
new_pat = ''
for i in range(n - 1):
	if pattern[i] == pattern[i + 1]:
		new_pat += pattern[i]
print(len(new_pat))


n = int(input())
t = input()
now = t[0]
ans = 0
for i in t[1:]:
	if now == i:
		ans += 1
	else:
		now = i
print(ans)


k = int(input())
x = input()
r = len(x)
c = 0
for i in range(0, r - 1):
	if x[i] == x[i + 1]:
		c += 1
print(c)


a = int(input())
s = input() + '.'
c = 0
it = 0
for i in range(1, a + 1):
	if s[i] == s[i - 1]:
		it += 1
	else:
		c += it
		it = 0
print(c)


z = 0
n = int(input())
p = input()
r = list(p)
x = 0
while x < len(r) - 1:
	while r[x] == r[x + 1]:
		del r[x]
		z = z + 1
		if x > len(r) - 2:
			break
	x = x + 1
print(z)


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


n = int(input())
s = str(input())
for a in range(n):
	if s.find('RR') != -1 or s.find('BB') != -1 or s.find('GG') != -1:
		s = s.replace('RR', 'R')
		s = s.replace('BB', 'B')
		s = s.replace('GG', 'G')
print(n - len(s))


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


testcase = int(input())
input_user = input()
counter = 0
temp = ''
for i in input_user:
	if i == temp:
		counter = counter + 1
	temp = i
print(counter)


input()
t = input()
s = 'f'
h = 0
for c in t:
	if c == s:
		h += 1
	s = c
print(h)


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


def stonesontheTable(arr):
	cnt = 0
	for s in range(len(arr) - 1):
		if arr[s] == arr[s + 1]:
			cnt += 1
	print(cnt)
a = int(input())
str = input()
if a == len(str):
	stonesontheTable(str)


n = int(input())
str = input()
j = 0
array = list(str)
for i in range(0, n - 1):
	if array[i] == array[i + 1]:
		j += 1
print(j)


x = int(input())
s = input()
a = []
t = 0
for i in range(x):
	a.append(s[i])
for i in range(1, x):
	if a[i] == a[i - 1]:
		t = t + 1
print(t)


x = int(input())
y = input()
c = 0
for i in range(x):
	if i == x - 1:
		if y[i - 1] == y[i]:
			break
	elif y[i] == y[i + 1]:
		c += 1
print(c)


def stone(s):
	d = len(s) - 1
	c = 0
	for i in range(d):
		if s[i] == s[i + 1]:
			c += 1
	print(c)
n = int(input())
s = input()
stone(s)


y = int(input())
i = input()
k = 0
for n in range(1, len(i)):
	if i[n] == i[n - 1]:
		k += 1
	else:
		continue
print(k)


n = int(input())
s_i = list(input())
s_e = list()
s_e.append(s_i[0])
com = s_i[0]
for ele in s_i:
	if ele != com:
		s_e.append(ele)
		com = ele
print(n - len(s_e))


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


n = int(input())
switches_num = 0
stones = [c for c in input()]
for idx in range(n - 1):
	if stones[idx] == stones[idx + 1]:
		switches_num += 1
print(switches_num)


input()
s = str(input())
global previous
previous = 'x'
global total
total = 0
for current in s:
	if previous != current:
		previous = current
	else:
		total = total + 1
print(total)


n = input()
row = list(input())
count = 0
for i in range(1, len(row)):
	current = row[i]
	previous = row[i - 1]
	if current == previous:
		count += 1
print(count)


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


n = int(input())
s = input()
L = []
c = 0
for i in s:
	if len(L) == 0:
		L.append(i)
	elif i != L[-1]:
		L.append(i)
	else:
		c += 1
print(c)


n = int(input())
a = str(input())
list = []
(i, j, c) = (0, 0, 0)
while i < n:
	list.append(a[i])
	i = i + 1
while j < n - 1:
	if list[j] == list[j + 1]:
		c = c + 1
	j = j + 1
print(c)


number = int(input())
s = input()
b = s
for i in range(number):
	s = s.replace('RR', 'R')
	s = s.replace('BB', 'B')
	s = s.replace('GG', 'G')
summa = len(b) - len(s)
print(summa)


from collections import Counter
import heapq

def nCommon(array, n):
	counter = Counter(array)
	topN = counter.most_common(n)
	return topN

def nLrgst(array, n):
	return heapq.nlargest(n, array)

def nSmlst(array, n):
	return heapq.nsmallest(n, array)

def solve():
	n = int(input())
	ss = input()
	counter = 0
	for x in range(n):
		try:
			if ss[x] == ss[x + 1]:
				counter += 1
		except IndexError:
			return counter

def main():
	print(solve())
main()


x = int(input())
y = input()
z = []
c = 0
d = 1
while d < x:
	if y[c] != y[d]:
		z.append(y[c])
	c += 1
	d += 1
z.append(y[-1])
v = ''
for i in z:
	v = v + i
print(x - len(v))


n = int(input())
s = input()
flag_r = False
flag_g = False
flag_b = False
c = 0
for i in range(n):
	if s[i] == 'R':
		if flag_r:
			c += 1
		flag_r = True
		flag_g = False
		flag_b = False
	elif s[i] == 'G':
		if flag_g:
			c += 1
		flag_r = False
		flag_g = True
		flag_b = False
	else:
		if flag_b:
			c += 1
		flag_r = False
		flag_g = False
		flag_b = True
print(c)


n = int(input())
s = input()
data = []
for i in range(len(s)):
	data.append(s[i])
c = 0
for i in range(len(data) - 1):
	if data[i + 1] == data[i]:
		c += 1
print(c)


x = int(input())
y = input()
g = 0
k = 0
for i in range(x - 1):
	if y[k] == y[k + 1]:
		g = g + 1
		k = k + 1
	else:
		k = k + 1
		continue
print(g)


def excessStone(n, l):
	cnt = 0
	for i in range(1, len(l)):
		if l[i] == l[i - 1]:
			cnt += 1
	return cnt

def main():
	n_sotnes = int(input())
	arr_stones = input()
	print(excessStone(n_sotnes, arr_stones))
main()


n = int(input())
list_of_stones = input()
list_of_stones = list(''.join(list_of_stones))
c = 0
i = 1
j = 0
while i != n:
	if list_of_stones[j] == list_of_stones[i]:
		c += 1
	i += 1
	j += 1
print(c)


def neighborsExist():
	global n, sl
	for i in range(n):
		if i == 0 and n == 1:
			return False
		elif i == 0:
			if sl[i] == sl[i + 1]:
				return True
		elif i == n - 1:
			if sl[i] == sl[i - 1]:
				return True
		elif sl[i] == sl[i - 1] or sl[i] == sl[i + 1]:
			return True
	return False

def firstNeighborRemoved():
	global c, n, sl
	c += 1
	for i in range(n):
		if i == 0:
			if sl[i] == sl[i + 1]:
				sl.pop(i)
				n -= 1
				return
		elif i == n - 1:
			if sl[i] == sl[i - 1]:
				sl.pop(i)
				n -= 1
				return
		elif sl[i] == sl[i - 1] or sl[i] == sl[i + 1]:
			sl.pop(i)
			n -= 1
			return
n = int(input())
sl = list(input())
c = 0
while neighborsExist():
	firstNeighborRemoved()
print(c)


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


color_count = int(input(''))
characters = input('')
last_color = None
removed_stones = 0
for char in characters:
	if last_color is None:
		last_color = char
	elif last_color == char:
		removed_stones += 1
		last_color = char
	last_color = char
print(removed_stones)


n = int(input())
stones = input()
count = 0
for index in range(n - 1):
	if stones[index] == stones[index + 1]:
		count += 1
print(count)


n = int(input())
s = input()
l = n
p = 0
for i in range(0, l - 1):
	if s[i] == s[i + 1]:
		s = s.replace(s[i], ' ', 1)
		p += 1
print(p)


_ = input()
stones = list(input())
result = 0
for i in range(1, len(stones)):
	if stones[i] == stones[i - 1]:
		result += 1
print(result)


i = int(input())
s = input()
f = ['RR', 'GG', 'BB']
r = 0
for i in f:
	try:
		while True:
			idx = s.index(i)
			s = s[:idx] + s[idx + 1:]
			r += 1
	except ValueError as e:
		pass
print(r)


n = int(input())
while n < 1 or n > 50:
	exit()
string = input()
count = 0
j = 0
for i in range(0, n):
	j += 1
	if j < n:
		if string[i] == string[j]:
			count += 1
print(count)


N = int(input())
string = input()
last = '0'
total = 0
for i in range(N):
	if string[i] == last:
		total += 1
	last = string[i]
print(total)


from functools import reduce
input()
string = input()
counter = [['RR', 'GG', 'BB'], [0, 0, 0]]
position = -1
for i in range(3):
	while True:
		position = string.find(counter[0][i], position + 1)
		if position == -1:
			break
		counter[1][i] += 1
print(reduce(lambda x, y: x + y, counter[1]))


n = int(input())
color = input()
count = 0
for (i, col) in enumerate(color):
	if i > 0:
		if col == color[i - 1]:
			count += 1
print(count)


a = int(input())
x = input()
count = 0
lst = []
count = 0
for i in range(a):
	lst.append(x[i])
for (x, y) in zip(lst[0:], lst[1:]):
	if x == y:
		count += 1
print(count)


num = int(input())
str = input()[:num]
count = 0
slen = len(str)
for i in range(slen - 1):
	if str[i] == str[i + 1]:
		count = count + 1
print(count)


(b, a) = (int(input()), list(input()))
(n, x) = (0, 0)
while True:
	if b == 1:
		break
	elif a[x] == a[x + 1]:
		a.remove(a[x + 1])
		n += 1
		if len(a) == 1:
			break
		if x == len(a) - 1:
			break
	else:
		x += 1
		if x == len(a) - 1:
			break
print(n)


from sys import stdin, stdout
a = int(stdin.readline())
b = stdin.readline()
cont = 0
i = 0
aux = len(b)
while i < aux - 1:
	if b[i] == b[i + 1]:
		cont += 1
	i += 1
stdout.write(str(cont))


n = int(input(''))
s = input('')
s = s.split()
lst = []
lst2 = []
if n >= 1 and n <= 50:
	for i in s:
		for y in i:
			lst.append(y)
lst2.append(lst[0])
for i in range(len(lst) - 1):
	if lst[i] != lst[i + 1]:
		lst2.append(lst[i + 1])
print(len(lst) - len(lst2))


y = int(input())
x = input()
z = [n for n in x]
r = 0
for n in range(len(z) - 1):
	if z[n] == z[n + 1]:
		r += 1
print(r)


from sys import stdin

def read():
	return stdin.readline()
n = int(read())
ar = [str(i) for i in read()]
sta = ar[0]
count = 0
for x in range(n - 1):
	if ar[x + 1] == sta:
		count += 1
	else:
		sta = ar[x + 1]
print(count)


n = input()
s = input()
prevC = None
result = 0
for c in s:
	if c == prevC:
		result += 1
	prevC = c
print(result)


y = int(input())
x = str(input())
count = 0
for c in range(0, len(x) - 1):
	if x[c] == x[c + 1]:
		count += 1
print(count)


n = input()
n = int(n)
s = input()
s = list(s)

def sim(l, i=0):
	if i == len(l) - 1:
		return l
	if l[i] == l[i + 1]:
		l.pop(i + 1)
		return sim(l, i)
	else:
		return sim(l, i + 1)
s1 = sim(s)
ans = n - len(s1)
print(ans)


a = int(input())
s = input()
c = 0
for k in range(len(s) - 1):
	if s[k + 1] == s[k]:
		c += 1
print(c)


def solve(stones):
	count = 0
	for i in range(1, len(stones)):
		if stones[i - 1] == stones[i]:
			count += 1
	return count
number_of_stones = input()
stones = input()
print(solve(stones))


x = int(input())
y = str(input())
inp1 = []
for i in range(x):
	jk = y[i]
	inp1.append(jk)
ans = 0
for i in range(len(inp1) - 1):
	if inp1[i] == inp1[i + 1]:
		ans += 1
	elif inp1[i] != inp1[i + 1]:
		ans += 0
print(ans)


n = int(input())
stones = input()
count = 0
while True:
	prevCount = count
	newStones = ''
	for i in range(1, len(stones)):
		if stones[i] == stones[i - 1]:
			count += 1
		else:
			newStones += stones[i]
	stones = newStones
	if prevCount == count:
		break
print(count)


n = int(input())
s = input()
S = []
for i in range(n):
	S.append(s[i])
a = s[0]
c = 0
for i in range(1, n):
	if a == S[i]:
		c += 1
	a = s[i]
print(c)


n = int(input())
string = input()
m = 0
color = string[0]
for i in range(n - 1):
	if string[i + 1] == color:
		m = m + 1
	else:
		color = string[i + 1]
print(m)


length = input()
sequence = input()
seqByR = sequence.split('R')
seqByG = sequence.split('G')
seqByB = sequence.split('B')
print(len(sequence) + 1 - (len(seqByR) - seqByR.count('') + len(seqByG) - seqByG.count('') + len(seqByB) - seqByB.count('')))


num = int(input(''))
a = str(input(''))
count = 0
for i in range(num):
	if i == 0:
		continue
	elif a[i - 1] == 'R' and a[i] == 'R' or (a[i - 1] == 'G' and a[i] == 'G') or (a[i - 1] == 'B' and a[i] == 'B'):
		count = count + 1
print(count)


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


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


n = int(input())
row = list(input())
min = 0
for i in range(n - 1):
	if row[i] == row[i + 1]:
		min += 1
print(min)


n = int(input())
ss = input()
cnt = 0
pre = ss[0]
for i in range(1, n):
	if ss[i] == pre:
		cnt += 1
	else:
		pre = ss[i]
print(cnt)


numberOfStones = int(input())
stones = list(input())
removedStones = 0
for i in range(numberOfStones - 1):
	if stones[i] == stones[i + 1]:
		removedStones += 1
print(removedStones)


def disFunction(previous, stones, changesRequired):
	isOk = True
	for i in range(0, previous - 1):
		if stones[i] == stones[i + 1]:
			isOk = False
			break
	if isOk:
		return changesRequired
	else:
		for j in range(0, previous - 1):
			if stones[j] == stones[j + 1]:
				newStones = ''
				for k in range(0, previous):
					if k != j:
						newStones += stones[k]
		return disFunction(len(newStones), newStones, changesRequired + 1)
n = int(input())
stones = str(input())
if n == 1:
	print(0)
elif n == 2:
	if stones[0] == stones[1]:
		print(1)
	else:
		print(0)
else:
	print(disFunction(n, stones, 0))


from collections import deque
from math import ceil, sqrt

def ii():
	return int(input())

def si():
	return input()

def mi():
	return map(int, input().split())

def li():
	return list(mi())
abc = 'abcdefghijklmnopqrstuvwxyz'
n = ii()
s = si()
if n == 1:
	print('0')
elif n == 2:
	if s[0] == s[1]:
		print('1')
	else:
		print('0')
else:
	if s[0] == s[1]:
		c = 1
	else:
		c = 0
	for i in range(1, n - 1):
		if s[i] == s[i + 1]:
			c += 1
	print(c)


n = int(input())
table = input()
curr = table[0]
encountered = False
ans = 0
for i in range(1, n):
	if curr == table[i]:
		ans += 1
	curr = table[i]
print(ans)


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


n = int(input())
colors = input()
lst = []
index = 0
count = 0
for i in colors:
	lst.append(i)
for i in range(len(lst) - 1):
	if lst[index] == lst[index + 1]:
		count += 1
		index += 1
	else:
		count += 0
		index += 1
print(count)


input()
stones = input().strip()
print(sum((s == t for (s, t) in zip(stones, stones[1:]))))


n = int(input())
color = str(input())
color_seq = []
move = 0
if len(color) == n:
	for i in range(len(color)):
		color_seq.append(color[i])
else:
	pass
for i in range(len(color_seq)):
	if i == 0:
		pass
	elif color_seq[i] == color_seq[i - 1]:
		move += 1
	else:
		pass
print(move)


temp = input()
s = input()
sum = 0
c = 1
for i in range(len(s) - 1):
	if s[i] == s[i + 1]:
		c += 1
	else:
		sum += c - 1
		c = 1
sum += c - 1
print(sum)


n = int(input())
m = input()
l = len(m)
c = 0
for i in range(l - 1):
	if m[i] == m[i + 1]:
		c += 1
print(c)


n = int(input())

def f(x):
	if x > 0:
		return x - 1
	return 0
c = 0
r = 0
b = 0
g = 0
inp = input()
for i in inp:
	if i == 'R':
		c = c + f(b) + f(g)
		b = 0
		g = 0
		r = r + 1
	elif i == 'B':
		c = c + f(r) + f(g)
		r = 0
		g = 0
		b = b + 1
	elif i == 'G':
		c = c + f(r) + f(b)
		r = 0
		b = 0
		g = g + 1
c = c + f(r) + f(b) + f(g)
print(c)


n = int(input())
stones = list(input())
i = 0
ans = 0
count = 0
while count < n - 1:
	if stones[i] == stones[i + 1]:
		del stones[i + 1]
		ans += 1
	else:
		i = i + 1
	count += 1
print(ans)


total = 0
stones = int(input())
colours = list(input())

def clearSame(aList):
	global total
	i = 0
	while i < len(aList) - 1:
		if aList[i] == aList[i + 1]:
			aList.pop(i + 1)
			i -= 1
			total += 1
		i += 1
	return aList
colours = clearSame(colours)
print(total)


n = int(input())
s = input()
r = []
cnt = 0
c = 0
r.append(s[0])
for i in range(1, n):
	if s[i] == r[c]:
		cnt += 1
	else:
		c += 1
		r.append(s[i])
print(cnt)


n = int(input())
stones = list(input())
pick = 0
for i in range(len(stones) - 1):
	if stones[i] == stones[i + 1]:
		pick = pick + 1
print(pick)


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


input()
s = input()
i = 0
count = 0
while i + 1 < len(s):
	if s[i] == s[i + 1]:
		if i > 0:
			s = s[:i] + s[i + 1:]
		else:
			s = s[i + 1:]
		count += 1
	else:
		i += 1
print(count)


q = input()
p = input()

def split(word):
	return list(word)
n = split(p)
inra = 0
for i in range(1, int(q)):
	if n[i] == n[i - 1]:
		inra += 1
print(inra)


n = int(input())
s = input()
l = []
i = int(0)
for x in s:
	l.append(x)
for z in range(0, n - 1):
	if l[z] == l[z + 1]:
		i += 1
print(i)


import sys
try:
	sys.stdin = open('inputs.txt', 'r')
	sys.stdout = open('output.txt', 'w')
except:
	pass
finally:
	input = sys.stdin.readline
	print = sys.stdout.write
n = int(input())
stones = input()
count = 0
for i in range(1, n):
	if stones[i] == stones[i - 1]:
		count += 1
print(str(count))


def Stones(s):
	count = 0
	for i in range(len(s) - 1):
		if s[i] == s[i + 1]:
			count = count + 1
	return count
x1 = int(input())
x = input()
print(Stones(x))


numberOfStones = int(input())
color = input()
previousStone = color[0]
result = 0
for x in range(1, numberOfStones):
	if color[x] == previousStone:
		result += 1
	previousStone = color[x]
print(result)


n = int(input())
colors = input()
prevColor = colors[0]
runLen = 1
remove = 0
for color in colors[1:]:
	if color == prevColor:
		runLen += 1
	else:
		remove += runLen - 1
		runLen = 1
	prevColor = color
remove += runLen - 1
print(remove)


(n, s) = (int(input()), input())
result = sum((prev_stone == stone for (prev_stone, stone) in zip(s[1:], s)))
print(result)


x = int(input())
y = input().upper()
i = 0
remv = 0
for i in range(x):
	z = y[i]
	if i != len(y) - 1:
		if y[i] == y[i + 1]:
			remv += 1
	i += 1
print(remv)


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


n = int(input())
st = str(input())
st = list(st)
st.append('NULL')
(i, count) = (0, 0)
while i < n:
	if st[i] != 'NULL':
		if st[i] == st[i + 1]:
			st.pop(i + 1)
			count += 1
		else:
			i += 1
			continue
	else:
		break
print(count)


length = int(input())
string = input()
stones = [i for i in string]
count = 0
for i in range(len(stones) - 1):
	if stones[i] == stones[i + 1]:
		count += 1
	else:
		count += 0
print(count)


x = int(input())
sin = input()
list1 = []
list1.append(sin[0])
i = 1
j = 0
while i < len(sin):
	if list1[j] != sin[i]:
		list1.append(sin[i])
		j += 1
	i += 1
print(x - len(list1))


number = int(input())
stones = input().strip()
stones_replaced = [0]
ctr = 0
for i in stones:
	if stones_replaced[-1] == i:
		ctr += 1
	stones_replaced.append(i)
print(ctr)


num = int(input())
s = str(input())
score = int(0)
for i in range(num - 1):
	if s[i] == s[i + 1]:
		score += 1
print(score)


n = int(input())
l = input()
ll = []
for i in range(0, len(l) - 1):
	if l[i] == l[i + 1]:
		ll.append(1)
	else:
		ll.append(0)
sums = 0
for i in range(0, len(ll)):
	sums = sums + ll[i]
print(sums)


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


from sys import stdin
n = int(stdin.readline().strip())
s = stdin.readline().strip()
c = 0
for (i, x) in enumerate(s):
	if i == len(s) - 1:
		break
	elif x == s[i + 1]:
		c += 1
print(c)


size = int(input())
word = input()
stack = []
stack.append('-')
for character in word:
	if character != stack[-1]:
		stack.append(character)
res = size - (len(stack) - 1)
print(res)


y = int(input())
t = input()
x = t[0:y]
w = 0
for r in range(0, len(x) - 1):
	if x[r] == x[r + 1]:
		w += 1
print(w)


number_of_stones = int(input())
stones = input()
res = 0
for processed_stone_no in range(number_of_stones - 1):
	if stones[processed_stone_no] == stones[processed_stone_no + 1]:
		res += 1
print(res)


n = int(input())
a = input()
ananas = 0
prev = a[0]
for i in range(1, n):
	if a[i] == prev:
		ananas += 1
	else:
		prev = a[i]
print(ananas)


a = int(input())
stone = input()
count = 0
for i in range(0, a - 1):
	if stone[i] == stone[i + 1]:
		count = count + 1
print(str(count))


n = int(input())
A = list(input())
c = 0
i = 0
while i < n - 1:
	if A[i] == A[i + 1]:
		c += 1
	i += 1
print(c)


n = int(input())
stones = input()
sum = 0
for l in range(1, n):
	if stones[l] == stones[l - 1]:
		sum += 1
print(sum)


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


_ = input()
arr = input()
prev = arr[0]
count = 0
for current_letter in arr[1:]:
	if current_letter == prev:
		count += 1
	else:
		prev = current_letter
print(count)


n = int(input())
stones = list(input())
t = 0
number = 0
while True:
	if n > t + 1:
		tt = t + 1
		if stones[t] == stones[tt]:
			del stones[t]
			t = t - 1
			n = n - 1
			number = number + 1
		t = t + 1
	else:
		break
print(number)


n = int(input())
s = input()
s1 = s
for i in range(n):
	if 'RR' in s:
		s = s.replace('RR', 'R')
	elif 'BB' in s:
		s = s.replace('BB', 'B')
	elif 'GG' in s:
		s = s.replace('GG', 'G')
print(len(s1) - len(s))


input()
s = str(input())
sum = 0
for i in range(len(s)):
	if i == len(s) - 1:
		break
	if s[i] == s[i + 1]:
		sum += 1
print(sum)


nb = int(input())
r = str(input())
sol = 0
lc = r[0]
i = 0
while i < len(r) - 1:
	if r[i] == r[i + 1]:
		sol += 1
	i += 1
print(sol)


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


length = int(input())
string = str(input())
rn = 0
for i in range(length - 1):
	if string[i] == string[i + 1]:
		rn += 1
print(rn)


d = input()
r = 0
tf = [x.replace('R', '0').replace('G', '1').replace('B', '2') for x in input().split()]
tf = [int(x) for x in tf[0]]
d = 0
tt = len(tf)
while d < tt - 1:
	if tf[d] == tf[d + 1]:
		del tf[d + 1]
		d = 0
		tt = len(tf)
		r += 1
	else:
		d += 1
		tt = len(tf)
print(r)


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


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


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


y = int(input())
n = input()
p = 0
k = 'H'
l = list(n)
for j in l:
	if j == k:
		p = p + 1
		k = j
	else:
		k = j
print(p)


size = int(input())
s = str(input())
cnt = 0
for i in range(len(s) - 1):
	if s[i] == s[i + 1]:
		cnt += 1
print(cnt)


def main():
	n = int(input())
	string = list(input())
	pre = 'Q'
	count = 0
	for x in range(0, n):
		if pre == string[x]:
			count += 1
		pre = string[x]
	print(count)
main()


row = input()
n = int(row)
s = input()
a = []
cont = 0
for x in range(1, n):
	if s[x] == s[x - 1]:
		cont += 1
print(cont)


tam = int(input())
string = str(input())
cont = 0
for i in range(0, tam - 1):
	if string[i] == string[i + 1]:
		cont += 1
print(cont)


n = int(input())
s = input()
count = p = 0
for i in s:
	if i == p:
		count += 1
	p = i
print(count)


n = int(input())
asd = input()
zxc = 0
color = asd[0]
for i in range(1, n):
	if asd[i] == color:
		zxc = zxc + 1
	else:
		color = asd[i]
print(zxc)


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


n = int(input())
l = list(input())
c = ' '
count = 0
for i in l:
	if i == c:
		count += 1
	c = i
print(count)


input()
last = '@'
cnt = 0
for c in input():
	if c == last:
		cnt += 1
	last = c
print(cnt)


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


n = int(input())
s = input()
ct = 0
for c in ['R', 'G', 'B']:
	while c * 2 in s:
		s = s.replace(c * 2, c, 1)
		ct += 1
print(ct)


n = int(input())
s = input()
s = [i for i in s]
a = 0
i = 0
while True:
	if i + 1 > len(s) - 1:
		break
	if s[i] == s[i + 1]:
		s.remove(s[i])
		a += 1
		i -= 1
	i += 1
print(a)


n = int(input())
my_string = input()
current_index = 0
removed = []
if n == 1:
	print(0)
else:
	while current_index < n - 1:
		if my_string[current_index] == my_string[current_index + 1]:
			removed.append(my_string[current_index + 1])
		current_index += 1
	print(len(removed)) if len(removed) != n else print(n - 1)


n = int(input().strip())
s = input().strip()
c = 0
for (i, j) in zip(s, s[1:]):
	if i == j:
		c += 1
if c == len(s):
	print(c - 1)
else:
	print(c)


n = int(input())
s = input()
if len(s) == n:
	new = s
	for i in range(1, n):
		if s[i] == s[i - 1]:
			new = new[:i] + 'X' + new[i + 1:]
print(new.count('X'))


n = int(input())
str0 = input()
print(len(str0) - (1 + len([1 for i in range(1, len(str0)) if str0[i] != str0[i - 1]])))


b = int(input())
a = input()
sum = 0
for i in range(1, len(a)):
	if a[i] == a[i - 1]:
		sum += 1
print(sum)


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


n = int(input())
string = input()
tol = 0
temp = 0
for i in range(0, n - 1):
	if string[i] == string[i + 1]:
		temp += 1
	else:
		tol += temp
		temp = 0
	if i == n - 2 and temp != 0:
		tol += temp
print(tol)


n = int(input())
line = list(input())
new = []
for i in range(n - 1):
	if line[i] != line[i + 1]:
		new.append(line[i])
	else:
		continue
new.append(line[-1])
b = len(new)
c = len(line)
answer = c - b
print(answer)


p = int(input())
s = str(input())
R = G = B = 0
for i in range(1, p):
	if s[i - 1] == s[i]:
		if s[i] == 'R':
			R = R + 1
		elif s[i] == 'B':
			B = B + 1
		else:
			G = G + 1
print(R + G + B)


b = 0
n = int(input())
s = input()
a = list(s)
if n % 2 != 0:
	a.append('q')
for i in range(n - 1):
	if a[i] == a[i + 1]:
		b += 1
print(b)


n = int(input())
s = input()
result = sum((s[i] == s[i - 1] for i in range(1, n)))
print(result)


kamenov = int(input())
kamene = input()
zobrat = 0
aktualny_kamen = 'N'
for kamen in kamene:
	if aktualny_kamen == 'N':
		aktualny_kamen = kamen
	elif aktualny_kamen == kamen:
		zobrat += 1
	else:
		aktualny_kamen = kamen
print(zobrat)


def rgb(s):
	if len(s) == 1:
		return 0
	elif s[0] == s[1]:
		return 1 + rgb(s[1:])
	else:
		return 0 + rgb(s[1:])
n = int(input())
s = input()
print(rgb(s))


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


numst = input()
stones = input()
arr = []
prev = ''
for x in range(len(stones)):
	if prev != stones[x]:
		arr.append(stones[x])
		prev = stones[x]
print(len(stones) - len(arr))


input_s = input()
input_l = input()
mount = 0
pre = ''
for i in input_l:
	if i == pre:
		mount += 1
	else:
		pre = i
print(mount)


n = int(input())
line = input()
pre = line[0]
min = 0
for c in line[1:]:
	if c == pre:
		min += 1
	pre = c
print(min)


accum = 0
letters = int(input())
sequence = list(input())
for colors in range(1, letters):
	if sequence[colors] == sequence[colors - 1]:
		accum += 1
print(accum)


def count_overlapping_substrings(haystack, needle):
	count = 0
	i = -1
	while True:
		i = haystack.find(needle, i + 1)
		if i == -1:
			return count
		count += 1
n = int(input())
line = input()
cnt = count_overlapping_substrings(line, 'GG') + count_overlapping_substrings(line, 'BB') + count_overlapping_substrings(line, 'RR')
print(cnt)


n = int(input())
_color = input()
count = 0
if len(_color) > 1:
	for i in range(1, len(_color)):
		if i < len(_color):
			if _color[i - 1] == _color[i]:
				count = count + 1
		else:
			break
else:
	count = 0
print(count)


def kamienie(n, slowo):
	wynik = 0
	for i in range(1, n):
		if slowo[i - 1] == slowo[i]:
			wynik += 1
	return wynik
n = int(input())
slowo = input()
print(kamienie(n, slowo))


temp = input()
s = input()
cur = ''
cnt = 0
res = 0
for i in s:
	if cur == i:
		cnt += 1
	else:
		cur = i
		res += cnt
		cnt = 0
res += cnt
print(res)


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()
prev = 'A'
ans = 0
for c in s:
	if c == prev:
		ans += 1
	else:
		prev = c
print(ans)


n = int(input())
s = input()
ston = 0
char = ''
for i in s:
	if i == char:
		ston += 1
	else:
		char = i
print(ston)


n = input()
s = list(map(ord, list(input())))
ans = 0
for i in range(1, len(s)):
	if s[i] == s[i - 1]:
		ans += 1
print(ans)


x = int(input())
l = input()
c = 0
for i in range(len(l) - 1):
	if l[i] == l[i + 1]:
		c += 1
print(c)


n = int(input())
s = input()
r = 0
i1 = 0
for i in range(n):
	while i1 + 1 <= len(s) - 1 and s[i1] == s[i1 + 1]:
		i1 += 1
		r += 1
	i1 += 1
print(r)


n = int(input())
cur = 0
mx = 0
ans = 0
s = 'A' + input()
for i in range(n):
	if s[i] == s[i + 1]:
		ans += 1
print(ans)


import re
n = int(input())
s = input()
print(len(s) - len(re.sub('(.)\\1+', '\\1', s)))


num = int(input())
n = input()
ncount = 0
k = 0
for i in range(num - 1):
	a = n[k]
	b = n[k + 1]
	if a == b:
		ncount += 1
		k += 1
	else:
		k += 1
print(ncount)


n = int(input())
color = input()
count = 0
char = color[0]
for i in range(1, len(color)):
	if char == color[i]:
		count += 1
	else:
		char = color[i]
print(count)


auxr = 0
auxg = 0
auxb = 0
aux2 = 0
a = int(input())
b = input()
for i in range(a):
	if b[i] == 'R':
		auxr += 1
	if b[i] == 'G':
		auxg += 1
	if b[i] == 'B':
		auxb += 1
	if i >= 1:
		if b[i] == 'R' and b[i - 1] == 'R':
			aux2 += 1
		if b[i] == 'G' and b[i - 1] == 'G':
			aux2 += 1
		if b[i] == 'B' and b[i - 1] == 'B':
			aux2 += 1
print(aux2)


a = int(input())
b = input()
h = 0
n = 0
for i in range(a):
	if b[i] != n:
		n = b[i]
	else:
		h += 1
print(h)


def deleter(num, colors):
	counter = 0
	colors = colors.lower()
	for i in range(0, len(colors) - 1):
		if colors[i] == colors[i + 1]:
			counter += 1
		else:
			continue
	print(counter)
a = int(input())
b = str(input())
deleter(a, b)


length = int(input())
stones = input()
array = []
for each in stones:
	array.append(each)
ans = 0
for each in range(0, length - 1):
	current = array[each]
	nxt = array[each + 1]
	if current == nxt:
		ans += 1
print(ans)


n = int(input())
color = input()
counter = 0
for i in range(len(color)):
	if i + 1 < len(color) and color[i] + color[i + 1] in ['RR', 'GG', 'BB']:
		counter += 1
	else:
		counter = counter
print(counter)


t = int(input())
k = list(input())
c = 0
j = 1
f = 0
while j < len(k):
	if k[j - 1] == k[j]:
		c = c + 1
		j = j + 1
	else:
		j = j + 1
print(c)


q = int(input())
s = input()
i = 0
while i < len(s) - 1:
	if s[i] == s[i + 1]:
		s = s[:i] + s[i + 1:]
	else:
		i += 1
print(q - len(s))


leng = int(input())
s = input()
el = s[0]
c = 0
for i in range(1, leng):
	if s[i] == el:
		c += 1
	else:
		el = s[i]
print(c)


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


n = int(input())
colors = input().strip()
count = 0
new_color = ''
for i in range(n):
	current = colors[i]
	if current == new_color:
		count += 1
	else:
		new_color = current
print(count)


n = int(input())
str = input()
i = 0
res = 0
for l in str:
	if i == len(str) - 1:
		break
	if l == str[i + 1]:
		res += 1
	i += 1
print(res)


hj = int(input())
dfk = input()
fg = 0
for i in range(0, hj - 1):
	j = i + 1
	if dfk[i] == dfk[j]:
		fg += 1
print(fg)


num = int(input())
var = input()
sum = 0
for x in range(len(var) - 1):
	if var[x] == var[x + 1]:
		sum += 1
print(sum)


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


numStones = eval(input())
stones = input()
stones = list(stones)
count = 0
for x in range(numStones - 1):
	if stones[x] == stones[x + 1]:
		count += 1
print(count)


istr = int(input())
jstr = input()
count = 0
for i in range(len(jstr) - 1):
	if jstr[i] == jstr[i + 1]:
		count += 1
print(count)


input()
a = input()
b = ''
c = 0
for i in a:
	if b == '':
		b = i
	elif b == i:
		c += 1
	else:
		b = i
print(c)


n = int(input())
string = input()
lstring = list(string)
count = 0
for i in range(0, n - 1):
	if lstring[i] == lstring[i + 1]:
		count += 1
	i += 1
print(count)


n = int(input())
colors = input()
same = 0
for index in range(len(colors) - 1):
	if colors[index] == colors[index + 1]:
		same += 1
print(same)


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


n = int(input())
string = input()
L = len(string)
count = 0
for i in range(L - 2):
	if string[i] == string[i + 1]:
		count += 1
if string[L - 1] == string[L - 2] and L != 1:
	count += 1
print(count)


input()
colors = str(input()) + '_'
res = i = 0
while i < len(colors) - 1:
	if colors[i] == colors[i + 1]:
		res += 1
	i += 1
print(res)


x = int(input())
string = input()
m = 0
for i in range(1, x):
	if string[i] == string[i - 1]:
		m += 1
print(m)


test_case = int(input())
string = input()
count = 0
for i in range(1, len(string)):
	if string[i] == string[i - 1]:
		count += 1
print(count)


n = int(input())
s = input()
cnt = -1
tr = s[0]
for i in s:
	if tr == i:
		cnt += 1
	else:
		tr = i
print(cnt)


for _ in range(1):
	x = input()
	n = input()
	c = 0
	cur = n[0]
	for ele in n[1:]:
		if ele == cur:
			c += 1
		cur = ele
	print(c)


f = input()
k = input()
k = list(k)
p = len(k)
m = 0
x = 1
while x < len(k):
	if k[x] == k[x - 1]:
		k[x - 1] = '$'
		m += 1
	x += 1
k = ''.join(k)
k = k.split('$')
s = len(''.join(k))
print(p - s)


import sys

def input():
	return sys.stdin.readline().strip()

def iinput():
	return int(input())

def rinput():
	return map(int, sys.stdin.readline().strip().split())

def get_list():
	return list(map(int, sys.stdin.readline().strip().split()))
n = iinput()
s = input()
s1 = list(s)
count = 0
for i in range(len(s1) - 1):
	if s1[i] == s1[i + 1]:
		count += 1
print(count)


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


_ = input()
l = list(input())

def f(l):
	for i in range(len(l) - 1):
		if l[i] == l[i + 1]:
			del l[i]
			return 1 + f(l)
	return 0
print(f(l))


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


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


from itertools import groupby
input()
s = input()
groups = [list(g) for (k, g) in groupby(s)]
groups = [len(x) - 1 for x in groups if len(x) > 1]
print(sum(groups))


n = int(input())
s = input()
l = s
for i in range(n):
	l = l.replace('RR', 'R').replace('BB', 'B').replace('GG', 'G')
print(len(s) - len(l))


n = int(input())
lst = input()
count = 0
for c in range(n - 1):
	if lst[c] == lst[c + 1]:
		count += 1
print(count)


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


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


useless = input()
temp_str = input()
count = 0
for x in range(temp_str.__len__() - 1):
	if temp_str[x] == temp_str[x + 1]:
		count += 1
print(count)


b = int(input())
a = input()
c = []
x = 0
for i in range(b):
	c.append(a[i])
for i in range(len(c) - 1):
	if c[i] == c[i + 1]:
		x = x + 1
print(x)


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


m = input()
n = input()
a = ''
k = 0
for i in n:
	if i in a:
		k = k + 1
		a = i
	else:
		a = i
print(k)


t = int(input())
n = input()
previous = n[0]
count = 0
for i in n[1:]:
	if i == previous:
		count += 1
	else:
		previous = i
print(count)


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


n = int(input())
A = list(input())
ans = 0
for i in range(1, n):
	p = A[i - 1]
	a = A[i]
	if p == a:
		ans += 1
print(ans)


def solve(colors):
	count = 0
	for (i, c) in enumerate(colors):
		if i > 0 and c == colors[i - 1]:
			count += 1
	return count
num_stones = input()
print(solve(input()))


stones = int(input())
text = input()
deletedStones = 0
pChar = text[0]
for x in text[1:]:
	if x == pChar:
		deletedStones += 1
	pChar = x
print(deletedStones)


n = int(input())
row = input()
sum = 0
for i in range(1, n):
	if row[i] == 'R' and row[i - 1] == 'R':
		sum += 1
	elif row[i] == 'B' and row[i - 1] == 'B':
		sum += 1
	elif row[i] == 'G' and row[i - 1] == 'G':
		sum += 1
print(sum)


n = int(input())
s = input()
prev = s[0]
i = 1
ans = 0
while i < n:
	while i < n and s[i] == prev:
		i += 1
		ans += 1
	if i < n:
		prev = s[i]
		i += 1
print(ans)


nstones = nstones_after = int(input())
previous = ''
for stone in input():
	if previous == stone:
		nstones_after -= 1
	previous = stone
print(nstones - nstones_after)


n = int(input())
a = list(input())
count = 0
z = ''
for i in a:
	if z == i:
		count = count + 1
	else:
		z = i
print(count)


import sys
(line, line_new) = [sys.stdin.readlines()[1][:-1]] * 2
for i in line:
	line_new = line_new.replace(i * 2, i)
print(len(line) - len(line_new))


def stones_on_the_table():
	n = int(input())
	s = input()
	final_count = 0
	count = 0
	for i in range(n):
		try:
			if s[i] == s[i + 1]:
				count += 1
			elif s[i] != s[i + 1]:
				final_count += count
				count = 0
		except:
			break
	final_count += count
	print(final_count)
stones_on_the_table()


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


import math, string, itertools, fractions, heapq, collections, re, array, bisect, sys, copy, functools
sys.setrecursionlimit(10 ** 7)
inf = 10 ** 20
eps = 1.0 / 10 ** 10
mod = 10 ** 9 + 7
dd = [(-1, 0), (0, 1), (1, 0), (0, -1)]
ddn = [(-1, 0), (-1, 1), (0, 1), (1, 1), (1, 0), (1, -1), (0, -1), (-1, -1)]

def LI():
	return list(map(int, sys.stdin.readline().strip().split()))

def LLI():
	return [list(map(int, l.split())) for l in sys.stdin.readlines().strip()]

def LI_():
	return [int(x) - 1 for x in sys.stdin.readline().strip().split()]

def LF():
	return [float(x) for x in sys.stdin.readline().strip().split()]

def LS():
	return sys.stdin.readline().strip().split()

def I():
	return int(sys.stdin.readline().strip())

def F():
	return float(sys.stdin.readline().strip())

def S():
	return sys.stdin.readline().strip()

def pf(s):
	return print(s, flush=True)

def pe(s):
	return print(str(s), file=sys.stderr)

def JA(a, sep):
	return sep.join(map(str, a))

def JAA(a, s, t):
	return s.join((t.join(map(str, b)) for b in a))
from math import factorial, gcd
from random import choice, randint
from sys import stdin, stdout
inp = stdin.readline
out = stdout.write

def main():
	t = I()
	s = S()
	c = 0
	for i in range(1, t):
		if s[i] == s[i - 1]:
			c += 1
	print(c)
main()


N = int(input())
P = input()
C = 0
for j in range(1, N):
	if P[j - 1] == P[j]:
		C += 1
print(C)


kolvo = int(input())
word = input().strip()
counter = 0
for i in range(kolvo - 1):
	if word[i] == word[i + 1]:
		counter += 1
print(counter)


x = int(input())
w = input()
y = 0
for i in range(y, x - 1):
	if w[i] == w[i + 1]:
		y = y + 1
print(y)


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


num_raw = int(input())
stones = list(input())
count = 0
if stones.count('R') > 1 or stones.count('B') > 1 or stones.count('G') > 1:
	for (idx, stone) in enumerate(stones):
		if idx == 0:
			if stone == stones[idx + 1]:
				count += 1
		elif idx == len(stones) - 1:
			pass
		elif stone == stones[idx + 1]:
			count += 1
print(count)


from sys import stdin
_input = stdin.readline
(_int, _str, _range) = (int, str, range)

def solution():
	n = _int(_input())
	s = _input().rstrip('\n')
	ans = 0
	for i in _range(n - 1):
		if s[i] == s[i + 1]:
			ans += 1
	if ans == n:
		print(ans - 1)
	else:
		print(ans)
solution()


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


n = int(input())
s = input()
ans = 0
war = 0
for i in range(n):
	try:
		if s[i] == s[i + 1]:
			ans += 1
	except:
		break
if n == 0 or n == 1:
	print(0)
else:
	print(ans)


def main():
	n = int(input())
	colour = input()
	count = 0
	previous_color = colour[0]
	for x in colour[1:]:
		if x == previous_color:
			count += 1
		previous_color = x
	print(count)
main()


stones = int(input()) - 1
s = list(input())
result = 0
for i in range(stones):
	if s[i] == s[i + 1]:
		result += 1
print(result)


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


k = input()
m = list(input())
cnt = 0
for i in range(1, len(m)):
	if m[i] == m[i - 1]:
		cnt = cnt + 1
print(cnt)


n = int(input())
stones = input()
i = 1
steps = 0
while n > 0 and i < n:
	if stones[i - 1] == stones[i]:
		stones = stones[:i - 1] + stones[i:]
		n -= 1
		steps += 1
	else:
		i += 1
print(steps)


n = int(input())
s = input()
s = list(s)
Sum = 0
i = 1
while i < len(s):
	if s[i - 1] == s[i]:
		del s[i - 1]
		Sum += 1
	elif s[-1] == s[-2]:
		del s[-1]
		Sum += 1
	else:
		i += 1
print(Sum)


lenght = int(input())
string = input()
string = string + 'A'
count = 0
for i in range(lenght):
	if string[i] != string[i + 1]:
		count += 1
print(lenght - count)


a = int(0)
result = 0
number_of_input = int(input())
input_color = str(input())
input_color = input_color + 'T'
for i in range(0, number_of_input):
	if input_color[i] == input_color[i + 1]:
		a += 1
	else:
		result += a
		a = 0
print(result)


n = int(input())
s = input()
i = 0
c = 0
while i < n - 1:
	a = i
	b = i + 1
	y = s[a]
	z = s[b]
	if y == z:
		c = c + 1
	i = i + 1
print(c)


n = int(input())
s = input()
res = 0
(l, r) = (0, 1)
while l <= r and l < n:
	while r < n and s[r] == s[l]:
		r += 1
	res += r - l - 1
	l = r
print(res)


n = int(input())
s = input()
v = list()
cont = 0
for i in range(len(s)):
	v.append(s[i])
b = list()
for i in range(len(v) - 1):
	if v[i] == v[i + 1]:
		cont += 1
	else:
		b.append(v[i])
print(cont)


x = int(input())
if x > 0 and x < 51:
	n = input()
	if len(n) == x:
		c = 0
		for i in range(0, x - 1):
			if n[i] == n[i + 1]:
				c += 1
		print(c)


n = int(input())
s = input()
a = []
for i in range(len(s)):
	a.append(s[i])
i = 0
while i < len(a) - 1:
	if a[i] == a[i + 1]:
		a.pop(i)
		i = 0
	else:
		i += 1
print(n - len(a))


n = int(input())
l = input()
ans = 0
for i in range(n - 1):
	if l[i] == l[i + 1]:
		ans += 1
	else:
		continue
print(ans)


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


stone = int(input())
colors = list(input())
count = 0
for index in range(1, stone):
	if colors[index - 1] == colors[index]:
		count += 1
print(count)


num = int(input())
line = input()
count = 0
for i in range(num - 1):
	if line[i] == line[i + 1]:
		count = count + 1
		line_new = line
		line_new = line_new[:i + 1] + line_new[i + 2:]
print(count)


n = int(input())
colors = input()
i = 1
count = 0
frtsLetter = colors[0]
while i < len(colors):
	if frtsLetter == colors[i]:
		count += 1
	frtsLetter = colors[i]
	i += 1
print(count)


x = int(input())
t = input()
c = 0
for j in range(len(t) - 1):
	if t[j] == t[j + 1]:
		c += 1
print(c)


nstr = input()
n = int(nstr)
s = input()
ans = 0
c = s[0]
for i in s[1:]:
	if i == c:
		ans = ans + 1
	c = i
print(ans)


z = int(input())
count = 0
color = input()
for i in range(1, z):
	if color[i - 1] == color[i]:
		count = count + 1
print(count)


n = int(input())
l = list(str(input()))
r = 0
for i in range(len(l) - 1):
	if l[i + 1] == l[i]:
		r += 1
print(r)


numberOfStones = int(input())
stones = [str(st) for st in input()]
previousStone = stones[0]
takeOut = 0
for stone in range(1, numberOfStones):
	if previousStone == stones[stone]:
		takeOut += 1
	previousStone = stones[stone]
print(takeOut)


n = int(input())
a = input()
print(sum((1 for i in range(n - 1) if a[i] == a[i + 1])))


import sys
number_of_stones = int(input())
stones = input()
left = 0
right = 1
removals = 0
while left < right and right <= len(stones) - 1:
	if stones[left] == stones[right]:
		removals += 1
	else:
		pass
	left += 1
	right += 1
print(removals)


pre = 'x'
res = int(input())
s = input()
for i in s:
	if i == pre:
		res -= 1
	pre = i
print(len(s) - res)


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


ans = 0
n = int(input())
inp = input()
x = []
for i in range(n):
	x.append(inp[i])
v = x[0]
for j in range(n):
	if j < n - 1:
		if v == x[j + 1]:
			ans = ans + 1
		else:
			v = x[j + 1]
print(ans)


def remove_invalid(s):
	out = []
	start = 0
	end = len(s)
	rm_count = 0
	for i in range(start, end):
		if i + 1 < end and s[i] == s[i + 1]:
			rm_count += 1
			continue
		else:
			out.append(s[i])
	return (out, rm_count)
_ = input()
stones = list(input())
rm_count = -1
tot_rm = 0
while rm_count != 0:
	(stones, rm_count) = remove_invalid(stones)
	tot_rm += rm_count
print(tot_rm)


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


input()
n = input()
m = len(n)
i = 0
c = 0
while i < m - 1:
	if n[i] == n[i + 1]:
		c = c + 1
	i = i + 1
print(c)


h = input()
n = input()
l = []
m = 0
for i in n:
	l.append(i)
for k in range(len(l) - 1):
	if l[k] == l[k + 1]:
		m += 1
print(m)


n = input()
s = input()
a = None
r = 0
for x in s:
	if a == x:
		r += 1
	a = x
print(r)


n = int(input())
a = list(input())
past = a[0]
k = 0
for i in range(1, n):
	if a[i] == past:
		k += 1
	past = a[i]
print(k)


n = eval(input())
colors = input()
temp = ''
count = 0
for color in colors:
	if color == temp:
		count += 1
	temp = color
print(count)


a = int(input())
s = input()
w = 0
ll = ''
for i in range(a):
	if ll == s[i]:
		w += 1
	ll = s[i]
print(w)


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


number = int(input())
s = input()
counter_B = 0
counter_G = 0
counter_R = 0
for i in range(number):
	if i == number - 1:
		break
	if s[i] == s[i + 1]:
		if s[i] and s[i + 1] == 'B':
			counter_B += 1
		elif s[i] and s[i + 1] == 'G':
			counter_G += 1
		else:
			counter_R += 1
print(counter_R + counter_G + counter_B)


import sys

def abc(str, n):
	cnt = 0
	for i in range(n - 1):
		if str[i] == str[i + 1]:
			cnt += 1
	return cnt
n = int(input())
str = input()
print(abc(str, n))


n = int(input())
arr = []
prev = ''
k = 0
for i in input() + ' ':
	if i != prev:
		arr.append(k)
		prev = i
		k = 1
	else:
		k += 1
ans = 0
for i in arr[1:]:
	ans += i - 1
print(ans)


n = int(input())
stones = input()
removed = 0
for i in range(0, len(stones)):
	if i + 1 <= len(stones) - 1 and stones[i] == stones[i + 1]:
		removed += 1
print(removed)


def a():
	z = int(input())
	s = list(input())
	z = 0
	for i in range(len(s) - 1):
		if s[i] == s[i + 1]:
			z += 1
	print(z)
a()


input()
s = list(input())
i = c = 0
while i < len(s):
	if i + 1 != len(s) and s[i] == s[i + 1]:
		s.remove(s[i])
		c += 1
		continue
	i += 1
print(c)


a = int(input())
stones = input()
myList = []
counter = 0
for i in range(1, a):
	if stones[i] == stones[i - 1]:
		counter += 1
	else:
		continue
print(counter)


n = int(input())
l = input()
S = ['1' for i in range(n - 1) if l[i] == l[i + 1]]
print(len(S))


n = int(input())
stones = list(input())
count = 0
abc1 = 0
res = 0
for i in stones:
	if i != abc1:
		count = 0
		abc1 = i
	else:
		count += 1
		if count >= 1:
			res += 1
print(res)


num = int(input())
col = str(input())
n = 0
cnt = 0
for i in range(len(col) - 1):
	if col[n] == col[n + 1]:
		n += 1
		cnt += 1
	else:
		n += 1
print(cnt)


n = input()
colores = input()
print(sum([1 for i in range(int(n) - 1) if colores[i] == colores[i + 1]]))


l = int(input())
s = input()
p = s[0]
cnt = 0
for i in range(1, l):
	if s[i] == p:
		cnt += 1
	p = s[i]
print(cnt)


times = int(input())
ane = list(input())
count = 0
for i in range(len(ane) - 1):
	if ane[i] == ane[i + 1]:
		count = count + 1
print(count)


x = int(input())
order = input()
s = list(order)
count = 0
for i in range(0, x - 1):
	if s[i] == s[i + 1]:
		count += 1
print(count)


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


__author__ = 'runekri3'
input()
stones = input()
(last_stone, stones) = (stones[0], stones[1:])
answer = 0
for stone in stones:
	if stone == last_stone:
		answer += 1
	last_stone = stone
print(answer)


number = int(input())
text = list(input())
n = 0
for i in range(number - 1):
	if text[i] == text[i + 1]:
		n += 1
print(n)


number_of_stones = int(input())
colours = input()
colours = list(colours)
t = len(colours)
counter = 0
i = 0
while t > 0:
	if len(colours) == i + 1:
		break
	elif colours[i] == colours[i + 1]:
		counter += 1
	i += 1
	t -= 1
print(counter)


n = int(input())
stones = input()
comp = ''
for i in range(n - 1):
	if stones[i] != stones[i + 1]:
		comp += stones[i]
comp += stones[-1]
print(n - len(comp))


n = int(input())
a = list(input())
i = n
j = 0
while j < n - 1:
	if a[j] == a[j + 1]:
		i = i - 1
	j = j + 1
print(n - i)


(pocet, kamene, odpoved) = (int(input()), input(), 0)
for i in range(len(kamene) - 1):
	if kamene[i + 1] == kamene[i]:
		odpoved += 1
print(odpoved)


num = int(input())
string = str(input())
prev = 0
index = 0
count = 0
for s in string:
	if prev == s:
		count += 1
		continue
	if prev == 0:
		prev = s
		continue
	prev = s
print(count)


test = int(input())
str = input()
str1 = list(str)
count = 0
if str1.count('R') == len(str1) or str1.count('G') == len(str1) or str1.count('B') == len(str1):
	while len(str1) != 1:
		str1.pop()
		count += 1
	print(count)
else:
	for i in range(0, len(str1) - 1):
		if str[i] == str[i + 1]:
			str.replace(str[i], 'X')
			count += 1
	print(count)


a = int(input())
b = str(input())
res = [v for (i, v) in enumerate(b) if i == 0 or v != b[i - 1]]
print(len(b) - len(res))


input()
Total = 0
i = 0
piedras = list(input())
while i < len(piedras) - 1:
	if piedras[i] == piedras[i + 1]:
		Total += 1
	i += 1
print(Total)


l = int(input())
t = input()
i = 0
min = 0
c = ''
while i < l:
	if t[i] == c:
		min += 1
	else:
		c = t[i]
	i += 1
print(min)


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


ms = int(input())
msk = input()
c = 0
for i in range(ms - 1):
	if msk[i] == msk[i + 1]:
		c += 1
print(c)


import re
n = int(input())
initialLine = input()
line = initialLine
numOfTaken = 0
prevLine = line
while True:
	line = re.sub('[R]+', 'R', line)
	line = re.sub('[G]+', 'G', line)
	line = re.sub('[B]+', 'B', line)
	if line == prevLine:
		break
	prevLine = line
print(len(initialLine) - len(line))


valor = int(input())
lista = input()
y = 'A'
soma = 0
for x in lista:
	if x == y:
		soma = soma + 1
	else:
		y = x
print(soma)


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


input()
prev = ''
count = 0
for i in input():
	if i != prev:
		prev = i
	else:
		count += 1
print(str(count))


n_stones = int(input())
stones = input()
count = 0
subR = 'RR'
subG = 'GG'
subB = 'BB'
hasR = hasG = hasB = True
while True:
	if hasR == False and hasG == False and (hasB == False):
		break
	resR = stones.find(subR)
	if resR != -1:
		stones = stones[0:resR] + stones[resR + 1:]
		count += 1
		hasR = True
	else:
		hasR = False
	resG = stones.find(subG)
	if resG != -1:
		stones = stones[0:resG] + stones[resG + 1:]
		count += 1
		hasG = True
	else:
		hasG = False
	resB = stones.find(subB)
	if resB != -1:
		stones = stones[0:resB] + stones[resB + 1:]
		count += 1
		hasB = True
	else:
		hasB = False
print(count)


numbers = input()
colours = input()
i = 0
repeat = colours[0]
for item in colours:
	if item == repeat:
		i += 1
	repeat = item
print(i - 1)


number_of_colors = int(input())
word = input('')

def touching_letters():
	touching_letters_count = 0
	for a in range(number_of_colors - 1):
		if word[a] == word[a + 1]:
			touching_letters_count += 1
	return touching_letters_count
print(touching_letters())


x = int(input())
s = input()
i = 0
r = x
a = [str(e) for e in s]
while i < x - 1:
	if a[i] == a[i + 1]:
		a.remove(a[i])
		x -= 1
		i -= 1
	i += 1
print(r - x)


n = input()
s = input()
l = list(s)
count = 0
i = 1
while i < len(l):
	if l[i] == l[i - 1]:
		l.pop(i)
		count += 1
	else:
		i += 1
print(count)


n = int(input())
stones = input()
count = 0
prev = stones[0]
for s in stones[1:]:
	if s == prev:
		count += 1
	else:
		prev = s
print(count)


string_length = int(input())
input_string = input()
count = 0
for (index, char) in enumerate(input_string):
	if index == 0:
		continue
	elif char == input_string[index - 1]:
		count += 1
	else:
		pass
print(count)


n = int(input())
stone = list(input())
ant = None
atual = None
count = 0
for i in range(n):
	atual = stone[i]
	if i == 0:
		ant = stone[i]
		continue
	if ant == atual:
		count += 1
	ant = atual
print(count)


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


n = int(input())
line = input()
k = 0
prev = line[0]
for i in line[1:]:
	if i == prev:
		k += 1
	else:
		prev = i
print(k)


n = int(input())
colors = input()
taken = 0
previous = '0'
for stone in colors:
	if stone == previous:
		taken += 1
	else:
		previous = stone
if previous == '0':
	print(0)
else:
	print(taken)


ee = input()
a = input()
ol = len(a)
while 'RR' in a or 'BB' in a or 'GG' in a:
	a = a.replace('RR', 'R').replace('GG', 'G').replace('BB', 'B')
print(ol - len(a))


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


n = int(input())
l1 = list(input())
tot = 1
for i in range(n - 1):
	if l1[i] == l1[i + 1]:
		tot += 1
print(tot - 1)


n = int(input())
s = input()
i = n - 1
j = n - 2
cnt = 0
while j != -1:
	if s[i] == s[j]:
		cnt += 1
		j -= 1
	else:
		i = j
		j -= 1
print(cnt)


def mynum(x, y):
	count = 0
	for i in range(x):
		try:
			if y[i] == y[i + 1]:
				count += 1
		except:
			pass
	print(count)
mynum(int(input()), input())


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


num = int(input())
color = input()
count = 0
for i in range(0, num - 1):
	if color[i] == color[i + 1]:
		count += 1
		i += 1
	else:
		i += 1
print(count)


count = 0
n = int(input())
s = list(input())
for i in range(1, len(s)):
	if s[i - 1] == s[i]:
		count += 1
	elif s[i - 1] != s[i]:
		continue
print(count)


stone = int(input())
color = str(input())
counter = 0
for i in range(0, stone - 1):
	if color[i] == color[i + 1]:
		counter += 1
print(counter)


n = input()
s = input()
t = ['M']
for i in s:
	if i != t[-1]:
		t.append(i)
print(len(s) - len(t) + 1)


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


t = int(input(''))
word = list(input(''))
a = 0
count = 0
for i in range(len(word)):
	if word[i] == a:
		count += 1
	else:
		a = word[i]
print(count)


n = input()
text = input()
prev = 'Y'
counter = 0
for c in text:
	if c == prev:
		counter += 1
	prev = c
print(counter)


lisa = input()
lisa = int(lisa)
jin = input()
count = 0
for i in range(len(jin) - 1):
	if jin[i] == jin[i + 1]:
		count += 1
print(count)


z = input()
a = input()
cur_count = 0
for i in range(len(a)):
	if i != len(a) - 1 and a[i] == a[i + 1]:
		cur_count = cur_count + 1
print(cur_count)


from itertools import groupby
n = int(input())
s = input()
print(n - len([k for (k, g) in groupby(s)]))


x = int(input())
y = input()
rem = 0
cmd = ''
for n in range(0, x):
	if y[n] == cmd:
		rem += 1
	cmd = y[n]
print(rem)


n = int(input())
a = input()
c = 0
for i in range(n):
	i = i + c
	for j in range(i + 1, n):
		if a[i] == a[j]:
			c = c + 1
		else:
			break
print(c)


n = int(input())
s = input()
mew = []
for i in range(n - 1):
	if s[i] is s[i + 1]:
		mew.append(s[i + 1])
print(len(mew))


n = int(input())
c = input()
lst = []
lstx = []
for i in c:
	lst.append(i)
for j in range(1, n):
	if lst[j - 1] != lst[j]:
		lstx.append(lst[j - 1])
print(len(lst) - (len(lstx) + 1))


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


n = input()
s = input()
slon = 0
cha = ''
for x in s:
	if x == cha:
		slon += 1
	else:
		cha = x
print(slon)


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


numberOfStones = input()
sequence = input()
prevChar = None
removals = 0
for char in sequence:
	if prevChar is None:
		prevChar = char
		continue
	if prevChar == char:
		removals = removals + 1
		continue
	else:
		prevChar = char
		continue
print(removals)


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


num_stones = int(input())
stones = input()
solution = 0
for pos in range(1, len(stones)):
	if stones[pos] == stones[pos - 1]:
		solution += 1
print(solution)


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


n = input()
s = input()
a = 0
p = 'C'
for letter in s:
	if letter == p:
		a += 1
	else:
		p = letter
print(a)


num = int(input())
inStr = input()
count = 0
for i in range(num - 1):
	if inStr[i] == inStr[i + 1]:
		count += 1
print(count)


from sys import stdin
num = int(stdin.readline())
n = stdin.readline().strip()
cont = 0
for i in range(len(n) - 1):
	if len(n) == 1:
		cont = 0
	elif n[i] == n[i + 1]:
		cont += 1
print(cont)


n = int(input())
s = input()
res = 0
while len(s) > 1:
	if s[0] == s[1]:
		res += 1
	s = s[1:]
print(res)


anzStones = int(input())
stones = input()
erg = 0
for i in range(0, len(stones) - 1):
	if stones[i] == stones[i + 1]:
		erg += 1
print(erg)


n = int(input())
s = input()
count = 0
prev = ''
for c in s:
	if c == prev:
		count += 1
	prev = c
print(count)


u = int(input())
k = input()
c = 0
for i in range(len(k) - 1):
	if k[i] == k[i + 1]:
		c += 1
print(c)


n = int(input())
str = input()
count = 0
for i in range(1, len(str)):
	if str[i] == str[i - 1]:
		count += 1
print(count, sep='', end='\n')


from itertools import groupby
n = int(input().strip())
stones = input()
removal = int()
for (key, seq) in groupby(stones):
	rep = list(seq)
	if len(rep) > 1:
		removal += len(rep) - 1
print(removal)


n = int(input())
s = input().strip()
s = '!' + s + '!'
j = 1
cnt = 0
for i in range(n):
	if s[i] == s[j]:
		cnt += 1
	j += 1
print(cnt)


n = int(input())
n1 = input()
n2 = []
for i in range(1, len(n1)):
	if n1[i] == n1[i - 1]:
		n2.append(n1[i])
print(len(n2))


n = int(input())
colors = input()
count_remove_rocks = 0
current_color = colors[0]
for color in colors[1:]:
	next_color = color
	if next_color == current_color:
		count_remove_rocks = count_remove_rocks + 1
	else:
		current_color = next_color
print(count_remove_rocks)


from functools import reduce
n = int(input())
s = input()
removed = 0
for i in range(1, n):
	removed += 1 if s[i - 1] == s[i] else 0
print(removed)


import sys
count_stones = int(input())
string = str(input())
result = 0
for i in range(0, count_stones - 1):
	if string[i] == string[i + 1]:
		result += 1
print(result)


n = int(input())
colors = [ch for ch in input()]
count = 0
prev = colors[0]
for i in range(1, len(colors)):
	if colors[i] == prev:
		count += 1
	else:
		prev = colors[i]
print(count)


n_stones = int(input())
stones = input() + ' '
count = 0
for i in range(n_stones - 1):
	if stones[i] == stones[i + 1]:
		count += 1
print(count)


def solution(s):
	count = 0
	last = s[0]
	for i in s[1:]:
		if i == last:
			count += 1
		else:
			last = i
	return count
n = int(input())
s = input()
print(solution(s))


x = int(input())
y = list(input())
sumx = 0
i = 0
while i < x - 1:
	if y[i] == y[i + 1]:
		sumx += 1
	i += 1
print(sumx)


n = int(input())
line = input()
count = [0]
for i in range(n - 1):
	idx = i + 1
	if line[idx] == line[idx - 1]:
		count.append(count[idx - 1] + 1)
	else:
		count.append(count[idx - 1])
	for j in range(idx - 1):
		if line[idx] == line[j]:
			count[idx] = min(count[idx], count[j] + idx - j)
		else:
			count[idx] = min(count[idx], count[j] + idx - j - 1)
print(count[-1])


x = int(input())
y = input()
i = 1
count = 0
a = 0
while i <= x - 1:
	if y[i] == y[i - 1]:
		a += 1
	i += 1
print(a)


import math, string, itertools, fractions, heapq, collections, re, array, bisect, sys, random, time, copy, functools
sys.setrecursionlimit(10 ** 7)
inf = 10 ** 20
eps = 1.0 / 10 ** 10
mod = 10 ** 9 + 7
dd = [(-1, 0), (0, 1), (1, 0), (0, -1)]
ddn = [(-1, 0), (-1, 1), (0, 1), (1, 1), (1, 0), (1, -1), (0, -1), (-1, -1)]

def LI():
	return [int(x) for x in sys.stdin.readline().split()]

def LI_():
	return [int(x) - 1 for x in sys.stdin.readline().split()]

def LF():
	return [float(x) for x in sys.stdin.readline().split()]

def LS():
	return sys.stdin.readline().split()

def I():
	return int(sys.stdin.readline())

def F():
	return float(sys.stdin.readline())

def S():
	return input()

def pf(s):
	return print(s, flush=True)

def main():
	n = I()
	s = S()
	c = '-1'
	r = 0
	for t in s:
		if c == t:
			r += 1
		else:
			c = t
	return r
print(main())


amount_of_stones = int(input().strip())
table = str(input().strip())
final_word = ''
curr_word = None
for c in table:
	if curr_word == None:
		curr_word = c
		final_word += curr_word
	elif curr_word == c:
		continue
	else:
		curr_word = c
		final_word += curr_word
print(len(table) - len(final_word))


import sys
game = sys.stdin.read().split('\n')[1]
count = 0
prev = 'A'
for c in game:
	if c != prev:
		prev = c
		count += 1
print(str(len(game) - count))


n = int(input())
s = list(input())
fq = (n + 1) * [0]
s.append('N')
for i in range(n):
	fq[i] = 1
	if i > 0:
		if s[i] == s[i - 1]:
			fq[i] += fq[i - 1]
r = 0
for i in range(n):
	if fq[i + 1] > fq[i]:
		continue
	if fq[i] > 1:
		r += fq[i] - 1
print(r)


n = input()
string = input()
a = list(string)
x = 0
res = list(zip(a, a[1:]))
for i in res:
	if i[0] == i[1]:
		x += 1
print(x)


no = int(input())
clrs = input()
cnt = 0
while 'RR' in clrs or 'GG' in clrs or 'BB' in clrs:
	if 'RR' in clrs:
		clrs = clrs.replace('RR', 'R', 1)
		cnt += 1
	if 'GG' in clrs:
		clrs = clrs.replace('GG', 'G', 1)
		cnt += 1
	if 'BB' in clrs:
		clrs = clrs.replace('BB', 'B', 1)
		cnt += 1
print(cnt)


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


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


n = int(input())
str = input()
i = 1
count = 0
while True:
	if i == n:
		break
	if str[i] == str[i - 1]:
		count += 1
	i += 1
print(count)


x = input()
y = input()
z = sum([y[i] == y[i - 1] for i in range(1, len(y))])
print(z)


n = int(input())
a = input()
b = 0
for i in range(0, len(a) - 1):
	if a[i] != a[i + 1]:
		pass
	else:
		b += 1
		i += 1
print(b)


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


v = input()
x = list(input())
counter = 0
a = 0
b = 1
a_val = 'z'
b_val = 'z'
while b <= len(x) - 1:
	a_val = x[a]
	b_val = x[b]
	if a_val == b_val:
		counter += 1
		del x[b]
		b = b - 1
		a = a - 1
	a += 1
	b += 1
print(counter)


n = int(input())
s = input()
res = 0
for (i, k) in zip(s[1:], s):
	if i == k:
		res += 1
print(res)


n = int(input())
m = list(input())
counts = []
list1 = []
while len(m) != 0:
	current = m[0]
	if len(m) != 1:
		next_ = m[1]
	else:
		next_ = None
	m.pop(0)
	list1.append(current)
	if current != next_:
		counts.append(list1)
		list1 = []
		continue
	else:
		continue
count = 0
for yo in counts:
	if len(yo) == 1:
		continue
	else:
		while len(yo) != 1:
			yo.pop(0)
			count += 1
print(count)


import re

def inp():
	return int(input())

def inlt():
	return list(map(int, input().split()))

def insr():
	s = input()
	return list(s[:len(s) - 1])

def invr():
	return map(int, input().split())

def convert(n):
	a = []
	while n > 0:
		s = n % 10
		a.append(s)
		n //= 10
	return a
n = inp()
s = list(input())
c = 0
for i in range(1, n):
	if s[i] == s[i - 1]:
		s[i - 1] = 0
		c += 1
print(c)


n = int(input())
arr = input()
print(sum((arr[i] == arr[i + 1] for i in range(0, n - 1))))


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


input()
s = input()
stonenow = s[0]
res = 0
tmp = 1
for i in s[1:]:
	if i == stonenow:
		tmp += 1
	else:
		tmp -= 1
		if tmp < 0:
			tmp = 0
		res += tmp
		tmp = 1
	stonenow = i
tmp -= 1
if tmp < 0:
	tmp = 0
res += tmp
tmp = 0
print(res)


n = input()
colors = input()
y = ''
q = 0
for x in colors:
	if x == y:
		q += 1
	y = x
print(q)


n = int(input())
my_input = list(input())
my_list = [my_input[0]]
for i in my_input[1:]:
	if my_list[-1] != i:
		my_list.append(i)
print(n - len(my_list))


def main():
	_ = int(input())
	w = str(input())
	cnt = 0
	last = None
	for x in w:
		if last and last == x:
			cnt += 1
		last = x
	print(cnt)
main()


a = int(input())
string = input()
cont = 0
conca = string[0]
for i in range(a - 1):
	if string[i + 1] == string[i]:
		conca += string[i]
		cont += 1
print(cont)


s = int(input())
c = input()
i = 0
z = 0
while i < s:
	if i + 1 == s:
		break
	elif c[i] == c[i + 1]:
		z += 1
		i += 1
	else:
		i += 1
print(z)


n = int(input())
p = input()
s = [i for i in p]
c = 0
o = []
s += 'K'
while c < n:
	if s[c] != s[c + 1]:
		o.append(s[c])
	c += 1
print(len(s) - len(o) - 1)


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


n = eval(input())
stones = list(input())
stones_copy = stones.copy()
count = 0
if n == len(stones):
	for (index, color) in enumerate(stones):
		if index < len(stones) - 1:
			if stones[index] == stones[index + 1]:
				count += 1
print(count)


n = int(input())
a = list(input())
b = [a[0]]
k = 0
c = 0
for i in range(1, n):
	if a[i] == b[c]:
		k += 1
	else:
		b.append(a[i])
		c += 1
print(n - len(b))


def main():
	removed = 0
	n = int(input())
	stones = input()
	previous = stones[0]
	for i in range(1, n):
		current = stones[i]
		if current == previous:
			removed = removed + 1
		previous = current
	return removed
print(main())


import sys
input = sys.stdin.readline
n = int(input())
s = input()
c = 0
for i in range(len(s) - 1):
	if s[i:i + 1] == s[i + 1:i + 2]:
		c += 1
print(c)


n = int(input())
st = input()
ele = st[0]
ele_sum = 0
for i in range(n):
	if i != 0:
		if ele == st[i]:
			ele_sum += 1
	ele = st[i]
print(ele_sum)


input()
s = input()
q = 0
i = 0
while i < len(s) - 1:
	if s[i] == s[i + 1]:
		q += 1
	i += 1
print(q)


x = int(input())
stones = input()
count = 0
for i in range(1, x):
	if stones[i] == stones[i - 1]:
		count += 1
	else:
		continue
print(count)


a = input()
b = input()
import re
c = len(re.findall('(?=BB)', b))
d = len(re.findall('(?=GG)', b))
e = len(re.findall('(?=RR)', b))
print(c + d + e)


num_stones = int(input())
stones = input()
selected = list()
iteration_start = 0
iteration_stop = 1
while iteration_start < num_stones and iteration_stop < num_stones:
	if stones[iteration_start] == stones[iteration_stop]:
		selected.append(iteration_stop)
		iteration_stop += 1
	else:
		iteration_start = iteration_stop
		iteration_stop += 1
print(len(selected))


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


n = int(input())
r = input()
print(sum((r[i] == r[i - 1] for i in range(1, n))))


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


num = int(input())
word = input()
word = list(word)
final = [word[0]]
count = 0
for i in range(1, len(word)):
	if word[i] == final[-1]:
		count += 1
	if word[i] != final[-1]:
		final.append(word[i])
print(count)


n = int(input())
stone = list(input())
con = 0
for i in range(n):
	if i >= 1:
		if stone[i] == stone[i - 1]:
			con += 1
print(con)


t = int(input())
e = input()
ans = 0
cur = e[0]
for i in range(1, len(e)):
	temp = e[i]
	if temp == cur:
		ans = ans + 1
	cur = temp
print(ans)


def list_input():
	return list(map(int, input().split()))

def multiple_input():
	return map(int, input().split())
n = int(input())
s = input()
count = 0
for i in range(n - 1):
	if s[i] == s[i + 1]:
		count += 1
print(count)


n = input()
k = input()
k = [x for x in k]
counter = 0
i = 0
while i < len(k) - 1:
	if k[i] == k[i + 1]:
		k.pop(i + 1)
		counter += 1
	else:
		i += 1
print(counter)


def count(s):
	(last, val) = (s[0], 0)
	for i in s[1:]:
		if last == i:
			val += 1
		else:
			last = i
	return val
input()
print(count(input()))


n = int(input())
stone = input()
count = 0
color = stone[0]
for i in range(1, n):
	if stone[i] == color:
		count += 1
	else:
		color = stone[i]
print(count)


n = int(input())
s = input()
a = n
s1 = list(s)
i = 0
while i + 1 < n:
	if s1[i] == s1[i + 1]:
		del s1[i + 1]
		n = n - 1
	else:
		i = i + 1
b = len(s1)
print(a - b)


n = int(input())
s = input()
check = s[0]
l = []
c = 0
for i in range(n):
	if s[i] == check:
		c += 1
	else:
		l.append(c)
		c = 1
		check = s[i]
	if i == n - 1:
		l.append(c)
print(sum(l) - len(l))


input()
s = input()
res = 0
for a in 'RGB':
	for i in range(len(s) - 1):
		if s[i:i + 2] == a * 2:
			res += 1
print(res)


n = int(input(''))
s = str(input(''))
l = []
for i in range(n):
	l.append(s[i])
count = 0
i = 0
while i < len(l) - 1:
	if l[i] == l[i + 1]:
		count += 1
		del l[i]
	else:
		i += 1
print(count)


batas = input()
total = 0
huruf = input()
x = len(huruf)
for i in range(x):
	if i < x - 1:
		if huruf[i] == huruf[i + 1]:
			total += 1
	else:
		break
print(total)


n = input()
a = list(input())
c = 0
for i in range(len(a) - 1):
	if a[i] == a[i + 1]:
		c = c + 1
print(c)


import sys
n = int(sys.stdin.readline())
configuration = sys.stdin.readline()
removed = 0
previous = configuration[0]
for i in range(1, n):
	current = configuration[i]
	if current == previous:
		removed += 1
	previous = current
sys.stdout.write(str(removed))


s = int(input())
l = list(input())
if s == 1:
	print(0)
else:
	ans = 0
	i = 1
	j = 0
	while i < s:
		if l[i] == l[j]:
			ans += 1
			i += 1
		else:
			j = i
			i += 1
	print(ans)


n = int(input())
st = input()
i = 0
c = 0
if len(st) == 1:
	print('0')
else:
	while True:
		if st[i] == st[i + 1]:
			c += 1
		if i == n - 2:
			break
		i += 1
	print(c)


b = int(input())
a = input()
i = 0
count = 0
while i < len(a) - 1:
	if a[i] != a[i + 1]:
		i += 1
	else:
		a = a[0:i] + a[i + 1:]
		count += 1
print(count)


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


from itertools import groupby
n = int(input())
string = groupby(input())
arr = []
for (i, j) in string:
	arr.append((i, len(list(j))))
print(n - len(arr))


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


input()
n = 0
s = input()
while 'RR' in s or 'BB' in s or 'GG' in s:
	if 'RR' in s:
		s = s[:s.index('RR')] + s[s.index('RR') + 1:]
		n += 1
	if 'GG' in s:
		s = s[:s.index('GG')] + s[s.index('GG') + 1:]
		n += 1
	if 'BB' in s:
		s = s[:s.index('BB')] + s[s.index('BB') + 1:]
		n += 1
print(n)


t = int(input())
sttr = input()
c = 0
for i in range(t - 1):
	if sttr[i] == sttr[i + 1]:
		c = c + 1
print(c)


a = int(input())
c = input()
t = c[0]
i = 0
for m in range(1, a):
	b = c[m]
	if b == t[-1]:
		i += 1
	else:
		t += b
print(i)


import math
n = int(input())
s = input()
c = 'F'
res = 0
for i in s:
	if c == i:
		res += 1
	c = i
print(res)


n = int(input())
string = list(input())
count = 0
for i in range(n):
	if i >= n - 1:
		break
	elif string[i] == string[i + 1]:
		try:
			while string[i] == string[i + 1]:
				string.remove(string[i + 1])
				n -= 1
				count += 1
		except IndexError:
			pass
print(count)


def Main():
	n = int(input())
	stones = input()
	ans = 0
	for i in range(n - 1):
		if stones[i] == stones[i + 1]:
			ans += 1
	print(ans)
Main()


n = int(input(''))
inp = input('')
c = 0
for i in range(len(inp) - 1):
	if inp[i] == 'R' and inp[i + 1] == 'R' or (inp[i] == 'G' and inp[i + 1] == 'G') or (inp[i] == 'B' and inp[i + 1] == 'B'):
		c += 1
print(c)


number = int(input())
dices = input()
res = 0
for i in range(1, len(dices)):
	if dices[i] == dices[i - 1]:
		res += 1
print(res)


n = int(input())
m = input()
x = list()
for i in range(n):
	x.append(m[i])
t = 0
i = 0
count = 0
for i in range(len(x) - 1):
	if x[i] == x[i + 1]:
		count += 1
print(count)


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


n = int(input())
str = input()
isFirst = True
preCh = None
cnt = 0
for c in str:
	if isFirst:
		preCh = c
		isFirst = False
		continue
	if preCh is c:
		cnt += 1
	preCh = c
print(cnt)


def main():
	trash = input()
	string = input()
	removed = 0
	while string.find('BB') > -1:
		temp = string.replace('BB', 'B', 1)
		removed += 1
		string = temp
	while string.find('RR') > -1:
		temp = string.replace('RR', 'R', 1)
		removed += 1
		string = temp
	while string.find('GG') > -1:
		temp = string.replace('GG', 'G', 1)
		removed += 1
		string = temp
	print(removed)
main()


def Count(colors, x, c):
	while x in colors:
		colors = colors.replace(x, x[0], 1)
		c += 1
	return (colors, c)
fu = input()
c = 0
colors = input()
(colors, c) = Count(colors, 'BB', c)
(colors, c) = Count(colors, 'RR', c)
(colors, c) = Count(colors, 'GG', c)
print(c)


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


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


n = int(input())
colours = input()
value = 0
for i in range(len(colours)):
	try:
		if colours[i] == colours[i + 1]:
			value += 1
	except IndexError:
		pass
print(value)


p = input()
n = input()
m = 0
for r in range(len(n) - 1):
	if n[r] == n[r + 1]:
		m = m + 1
print(m)


input()
s = input()
ans = 0
prev = ''
for x in s:
	if x == prev:
		ans += 1
	prev = x
print(ans)


num = int(input())
string = input()
string = list(string)
cnt = 0
for i in range(1, num):
	if string[i] != string[i - 1]:
		continue
	else:
		cnt += 1
print(cnt)


n = int(input())
ss = input()
count = 0
now = ss[0]
for i in range(1, n):
	if ss[i] == now:
		count = count + 1
	else:
		now = ss[i]
print(count)


ilosc = int(input())
kamyki = input()
usun = 0
for i in range(1, ilosc):
	if kamyki[i - 1] == kamyki[i]:
		usun += 1
print(usun)


n = int(input())
s = input()
c = int(0)
ans = 0
l = s[0]
for j in s[1:n]:
	if l == j:
		s = s[0:c] + s[c + 1:len(s)]
		ans += 1
	if j != '*':
		l = j
print(ans)


piece = int(input())
color = list(input())
counter = 0
delete = 0
for i in range(piece):
	try:
		if color[counter] == color[counter + 1]:
			delete += 1
	except IndexError:
		pass
	counter += 1
print(delete)


from functools import reduce
n = int(input())
sequence_string = input()
count = 0
last_val = sequence_string[0]
for x in sequence_string[1:]:
	if last_val == x:
		count += 1
	else:
		pass
	last_val = x
print(count)


n = input()
s = input()
prev = s[0]
cnt = -1
for i in s:
	if i == prev:
		cnt += 1
	prev = i
print(cnt)


numbers = input()
colours = list(input())
i = 0
j = 0
while i + 1 < len(colours):
	if colours[i] == colours[i + 1]:
		colours.pop(i)
		j += 1
	else:
		i += 1
print(j)


n = int(input())
a = list(map(str, input()))
count = 0
for i in range(n - 1):
	if a[i] == a[i + 1]:
		count = count + 1
print(count)


n = int(input())
s = input()
initial = ''
total = 0
for x in s:
	if x == initial:
		total += 1
	else:
		initial = x
print(total)


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


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


n = int(input())
s = input()
sm = 0
arr = s[0]
for i in s[1:]:
	if i == arr:
		sm += 1
	arr = i
print(sm)


n = int(input())
colour = input()
i = 0
j = 0
while i < n - 1:
	memory = colour[i]
	i = i + 1
	clr = colour[i]
	if clr == memory:
		j = j + 1
	else:
		j = j
print(j)


from itertools import tee
input()
(s1, s2) = tee(input())
next(s2)
res = sum((a1 == a2 for (a1, a2) in zip(s1, s2)))
print(res)


x = int(input())
y = input()
t = 0
l = len(y) - 1
for i in range(0, l):
	if y[i] == y[i + 1]:
		t = t + 1
print(t)


n = int(input())
s = input()
p1 = 0
p2 = p1 + 1
c = 0
while p1 < p2 and p2 < n:
	if s[p1] == s[p2]:
		c = c + 1
		p2 = p2 + 1
	else:
		p1 = p2
		p2 = p2 + 1
print(c)


n = int(input())
l = list(map(str, input()))
sum = 0
for i in range(n):
	if i == n - 1:
		break
	elif l[i] == l[i + 1]:
		sum += 1
print(sum)


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


import sys

def solve():
	n = int(input())
	s = input()
	p = '#'
	ans = 0
	for ch in s:
		if ch == p:
			ans += 1
		p = ch
	print(ans)
solve()


n = int(input())
s = str(input())
t = []
d = []
c = 0
for i in range(len(s)):
	t.append(s[i])
d.append(s[0])
for i in range(1, len(t)):
	if t[i] == d[0]:
		c = c + 1
		del d[0]
		d.append(t[i])
	if t[i] != d[0]:
		del d[0]
		d.append(t[i])
print(c)


n = int(input())
stone = input()
num = 0
x = stone[0]
for i in range(n):
	if stone[i] == x:
		num += 1
	x = stone[i]
print(num - 1)


n = int(input())
a = str(input())
dp = [0]
for i in range(1, n):
	dp.append(0)
	if a[i] == a[i - 1]:
		dp[i] += 1
print(sum(dp))


x = int(input())
y = input()
count = 0
current = y[0]
for i in range(1, len(y)):
	if y[i] != current:
		current = y[i]
	elif y[i] == current:
		count = count + 1
print(count)


wt = int(input())
str8 = input()
s = ''
for i in range(wt - 1):
	if str8[i] != str8[i + 1]:
		s = s + str8[i]
print(wt - len(s) - 1)


s = int(input())
e = input()
prev = e[0]
res = 0
for i in range(1, s):
	if prev == e[i]:
		res += 1
	prev = e[i]
print(res)


n = int(input())
ip = input()
count = 0
i = 0
while i < n - 1:
	j = 1
	while i + j < n and ip[j + i] == ip[i]:
		count += 1
		j += 1
	i += j
print(count)


k = input()
ip = input()
l = len(ip)
i = 0
count = 0
while i <= l - 2:
	if ip[i] == ip[i + 1]:
		count += 1
	i += 1
print(count)


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


arg = int(input())
s = input()
res = 0
curr = s[0]
for d in range(1, len(s)):
	if s[d] == curr:
		res += 1
	curr = s[d]
print(res)


n = int(input())
s = input()
li = []
for i in s:
	li.append(i)
ind = 0
count = 0
for i in range(len(li) - 1):
	if li[ind] == li[ind + 1]:
		li.pop(ind + 1)
		count += 1
	else:
		ind += 1
print(count)


n = int(input())
colours = list(input())
num = 0
i = 0
while i + 1 <= len(colours) - 1:
	if colours[i] == colours[i + 1]:
		colours.pop(i + 1)
		num += 1
	else:
		i = i + 1
print(num)


line_1 = int(input())
line_2 = input()
count = 0
count_1 = 0
for x in range(line_1 - 1):
	if line_2[count] == line_2[count + 1]:
		count = count + 1
		count_1 = count_1 + 1
	else:
		count = count + 1
print(count_1)


input()
inp = input()
res = 0
for i in range(1, len(inp)):
	if inp[i] == inp[i - 1]:
		res += 1
print(res)


n = int(input())
a = list(input())
count = 0
l = 0
for i in range(len(a) - 1):
	if a[i] == a[i + 1]:
		count += 1
print(count)


noOfStones = int(input())
stones = input()
similar = [stones[i] for i in range(noOfStones - 1) if stones[i] == stones[i + 1]]
print(len(similar))


n = int(input())
s = input()
l = []
for a in s:
	l.append(a)
poppable = []
for i in range(len(l)):
	if i == 0 and i + 1 < len(l):
		if l[i] == l[i + 1]:
			poppable.append(l[i + 1])
	elif i - 1 >= 0 and i + 1 < len(l):
		if l[i - 1] == l[i] and l[i] == l[i + 1]:
			poppable.append(l[i])
		elif l[i] == l[i + 1]:
			poppable.append(l[i + 1])
print(len(poppable))


n = int(input())
yes = input()
i = 0
sea = 0
while i < len(yes) - 1:
	if yes[i] == yes[i + 1]:
		yes = yes[:i] + yes[i + 1:]
		sea += 1
	else:
		i += 1
print(sea)


n = int(input())
stones = input()
li = []
for i in stones:
	li.append(i)
l = len(li)
count = 0
for i in range(l - 1):
	if li[i] == li[i + 1]:
		count += 1
print(count)


n = int(input())
s = input()
c = 0
l = [str(x) for x in str(s)]
for i in range(len(l) - 1):
	if l[i] == l[i + 1]:
		c = c + 1
print(c)


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


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


a = int(input(''))
x = input('')
temp = 0
count = -1
for i in range(0, a):
	if x[i] == x[i - 1] or temp == 0:
		temp += 1
		count = count + 1
print(count)


def main(num, string):
	count = 0
	for i in range(0, num - 1):
		if string[i] == string[i + 1]:
			count += 1
	return count
num = int(input())
string = input()
print(main(num, string))


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


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


from itertools import groupby
n = int(input())
print(n - sum((1 for _ in groupby(input()))))


n = int(input())
arr = list(input())
res = 0
prev = arr[0]
for i in range(1, n):
	if arr[i] == prev:
		res += 1
	else:
		prev = arr[i]
print(res)


n = int(input())
s = input()
for i in range(n):
	assert s[i] == 'R' or s[i] == 'G' or s[i] == 'B'
del_time = 0
for i in range(1, n):
	curr = s[i]
	prev = s[i - 1]
	if curr == prev:
		del_time += 1
print(del_time)


t = int(input())
str = input()
res = str[0]
count = 0
for i in range(1, len(str)):
	if str[i] == res[-1]:
		count += 1
	else:
		res += str[i]
print(count)


n = int(input())
s = input()
s = ' '.join(s)
s = s.split()
a = 0
for i in range(len(s) - 1):
	if s[i] == s[i + 1]:
		a = a + 1
print(a)


p = input()
n = list(input())
count = 0
for i in range(len(n) - 1):
	if n[i] == n[i + 1]:
		count += 1
print(count)


try:
	n = int(input())
	s = input()
	ans = 0
	for i in range(len(s) - 1):
		if s[i] == s[i + 1]:
			ans = ans + 1
	print(ans)
except Exception:
	pass


n = int(input())
colores = input()
anterior = colores[0]
cont = 0
for i in colores[1:]:
	if i == anterior:
		cont = cont + 1
	anterior = i
print(cont)


a = int(input())
name = input()
score = 0
for i in range(a - 1):
	if name[i] == name[i + 1]:
		score += 1
print(score)


c = int(input())
st = input()
co = 0
for i in range(c - 1):
	if st[i] == st[i + 1]:
		co += 1
	else:
		pass
print(co)


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


t = input()
s = input()
st = []
c = 0
st.append(s[0])
for i in s[1:]:
	if st[len(st) - 1] == i:
		c = c + 1
	else:
		st.append(i)
print(c)


n = int(input())
string = input()
count = 0
j = 0
k = 1
while k < n:
	if string[j] == string[k]:
		count += 1
	j += 1
	k += 1
print(count)


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


n = int(input())
rememberedColor = None
a = list(input())
t = 0
for i in range(n):
	if a[i] == rememberedColor:
		t += 1
	rememberedColor = a[i]
print(t)


num = int(input())
seq = input()
count = 0
for i in range(num):
	if i >= 0 and i < num - 1:
		if seq[i] == seq[i + 1]:
			count += 1
print(count)


n = int(input())
anterior = ''
for c in input():
	if c != anterior:
		n -= 1
		anterior = c
print(n)


a = int(input())
s = input()
counter = 0
i = 0
while i < len(s) - 1:
	if s[i] == s[i + 1]:
		counter += 1
	i += 1
print(counter)


n = int(input())
a = list(input())
i = 1
x = 0
while i < len(a):
	if a[i] == a[i - 1]:
		x += 1
		a.pop(i - 1)
	else:
		i += 1
print(x)


num = int(input())
num_i = num
order = input()
prev = ''
for i in order:
	if i == prev:
		num -= 1
	prev = i
print(num_i - num)


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


n = int(input())
a = input()
count = 0
for i in range(len(a) - 1):
	b = a[i]
	c = a[i + 1]
	if b == c:
		count = count + 1
print(count)


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


a = input().strip().split()[0]
b = input().strip().split()[0]
if a == '0':
	print(0)
else:
	c = 0
	for i in range(1, len(b)):
		if b[i] == b[i - 1]:
			c = c + 1
	print(c)


input()
string = input()
flag = 0
for i in range(len(string) - 1):
	if string[i] == string[i + 1]:
		flag += 1
print(flag)


n = int(input())
s = input()
s = list(s)
ans = [s[0]]
for i in range(len(s)):
	if s[i] != ans[-1]:
		ans.append(s[i])
print(n - len(ans))


_ = input()
inp = input()
curr = inp[0]
count = 0
for c in inp[1:]:
	if c == curr:
		count += 1
	else:
		curr = c
print(count)


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


n = int(input())
inp = ' '.join(input()).split()
ris = 0
if len(inp) == 0 or len(inp) == 1 or (len(inp) == 2 and inp[0] != inp[1]):
	print(0)
elif len(inp) == 2 and inp[0] == inp[1]:
	print(1)
elif len(list(dict.fromkeys(inp))) == 1:
	print(len(inp) - 1)
else:
	for x in range(0, len(inp) - 1):
		if inp[x] == inp[x + 1]:
			ris += 1
	print(ris)


w = int(input())
t = 0
a = []
p = input()
a = list(p)
for i in range(1, w):
	if a[i - 1] == a[i]:
		t = t + 1
print(int(t))


a = input()
b = input()
c = list(b)
i = 0
count = 0
while i < len(c) - 1:
	if c[i] == c[i + 1]:
		c.remove(c[i + 1])
		count += 1
	else:
		i += 1
print(count)


n = int(input())
a = [i for i in input()]
c = 0
r = 0
while c < len(a) - 1:
	if a[c] == a[c + 1]:
		del a[c]
		r += 1
		c = 0
	else:
		c += 1
print(r)


n = int(input())
row = input()
if row[0] == row[-1]:
	num = -1
else:
	num = 0
for i in range(n):
	if row[i] == row[i - 1]:
		num += 1
print(num)


a = input()
colors = input()
c = 0
r = False
g = False
b = False
for i in colors:
	if i == 'R':
		if r:
			c = c + 1
		r = True
		g = False
		b = False
	elif i == 'G':
		if g:
			c = c + 1
		g = True
		r = False
		b = False
	elif i == 'B':
		if b:
			c = c + 1
		b = True
		r = False
		g = False
print(c)


input()
arr = [i for i in input()]
count = 0
for i in range(len(arr) - 1):
	if arr[i] == arr[i + 1]:
		count += 1
	else:
		continue
print(count)


s = input()
line = list(input())
lin = line[1:]
k = 0
for (stone, nextstone) in zip(line, lin):
	if stone == nextstone:
		k += 1
print(k)


import sys
import math
import os
n = int(input())
count = 0
data = input()
last = -1
for i in range(n):
	flag = 0
	if i > last:
		for k in range(i + 1, n):
			if data[i] == data[k]:
				count += 1
				last = k
			else:
				break
			if k == n - 1:
				flag = 1
	if flag == 1:
		break
print(count)


n = input()
s = input()
l = list(s)
(i, r) = (0, 0)
while i != len(s) - 1:
	if l[i] == l[i + 1]:
		r = r + 1
	i = i + 1
print(r)


n = input()
s = input()
m = ''
c = 0
for i in s:
	c = c + int(i == m)
	m = i
print(c)


n = int(input())
s = input()
pre = s[0]
count = 0
if len(s) == 1:
	print(0)
else:
	for i in range(1, len(s)):
		if s[i] == pre:
			count += 1
			continue
		pre = s[i]
	print(count)


a = int(input())
b = input()
c = ''
r = 0
for i in range(a):
	if b[i] == c:
		r += 1
	c = b[i]
print(r)


def ans(arr):
	cnt = 0
	i = 0
	while i < n - 1:
		if arr[i] == arr[i + 1]:
			cnt += 1
		i += 1
	return cnt
n = int(input())
s = list(input())
print(ans(s))


count = int(input())
line = input()
for i in range(len(line) - 1):
	if line[i + 1] == line[i]:
		count -= 1
print(len(line) - count)


a = int(input())
st = input()
mas = []
x = 0
z = 0
for i in st:
	mas.append(i)
while z != len(mas) - 1:
	z = 0
	for i in range(len(mas) - 1):
		if mas[i] == mas[i + 1]:
			del mas[i + 1]
			x += 1
			break
		if mas[i] != mas[i + 1]:
			z += 1
print(x)


number_of_stones = int(input(''))
color_of_stones = input('')
answer = 0
for i in range(number_of_stones - 1):
	if color_of_stones[i] == color_of_stones[i + 1]:
		answer += 1
print(answer)


b = int(input())
a = input()
p = 0
i = 1
while i < b:
	if a[i] == a[i - 1]:
		p = p + 1
	i = i + 1
print(p)


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


num = int(input())
n = list(input())
ncount = 0
for i in range(1, num):
	a = n[i - 1]
	b = n[i]
	if a == b:
		ncount += 1
print(ncount)


n = int(input())
x = input().lower()
y = '0' + x
output = 0
for i in range(n):
	if ord(x[i]) == ord(y[i]):
		output += 1
print(output)


def solve():
	ans = 0
	for j in range(1, len(S)):
		if S[j] == S[j - 1]:
			ans += 1
	print(ans)
	return
N = int(input())
S = input()
solve()


import sys
n = int(sys.stdin.readline())
in_str = sys.stdin.readline()
cur_ch = in_str[0]
res = 0
for c in in_str[1:n]:
	if cur_ch == c:
		res += 1
	else:
		cur_ch = c
print(res)


import sys
from os import path
if path.exists('input.txt'):
	sys.stdin = open('input.txt', 'r')
	sys.stdout = open('output.txt', 'w')
	sys.stderr = open('error.txt', 'w')
t = int(input())
s = input()
l = list(s)
count = 0
for i in range(len(s) - 1):
	if l[i] == l[i + 1]:
		count += 1
print(count)


def main():
	n = input()
	s = input()
	count = 0
	for i in range(len(s) - 1):
		if s[i] == s[i + 1]:
			count += 1
	return count
print(main())


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


n = int(input())
stones = input()
count = 0
i = 0
while i in range(n - 1):
	while stones[i] == stones[i + 1]:
		count += 1
		i += 1
		if i == n - 1:
			break
	i += 1
print(count)


n = int(input())
stone = input()
count = 0
for k in range(1, n):
	if stone[k] == stone[k - 1]:
		count += 1
print(count)


import random
many = int(input())
colors = input()
half1 = list()
half2 = list()
for (index, color) in enumerate(colors):
	if index + 1 <= many // 2:
		half1.append(color)
	else:
		half2.append(color)
todel = 0

def lastfirst(half1, half2):
	global todel
	thru = True
	if half1[-1] == half2[0]:
		del half2[0]
		thru = False
		todel += 1
	return thru

def firsthalf(half1):
	global todel
	thru = True
	for i in range(len(half1) - 1, 0, -1):
		if half1[i] == half1[i - 1]:
			del half1[i]
			todel += 1
			thru = False
	return thru

def secondhalf(half2):
	global todel
	thru = True
	for i in range(len(half2) - 1, 0, -1):
		if half2[i] == half2[i - 1]:
			del half2[i]
			todel += 1
			thru = False
	return thru
x = False
while not x:
	if half1 and half2:
		x = lastfirst(half1, half2)
	else:
		x = True
y = False
while not y:
	if half1:
		y = firsthalf(half1)
	else:
		y = True
z = False
while not z:
	if half2:
		z = secondhalf(half2)
	else:
		z = True
print(todel)


def main():
	s = int(input())
	lst = input()
	count = 0
	a = lst[0]
	for i in lst[1:]:
		if i == a:
			count += 1
		a = i
	print(count)
main()


a = p = 0
input()
for i in input():
	a += i == p
	p = i
print(a)


n = int(input())
a = input()
x = ''
last = ''
count = 0
for i in range(n):
	if a[i] != last:
		x += a[i]
		last = a[i]
	else:
		count += 1
print(count)


n = int(input())
l = input()
count = 0
for i in range(n - 1):
	if l[i:i + 2] in ('RG', 'RB', 'GB', 'GR', 'BR', 'BG'):
		count += 1
print(len(l) - count - 1)


import re
input()
x = re.findall('RR+|BB+|GG+', input())
print(sum(list(map(len, x))) - len(x))


cycle = int(input()) - 1
s = input()
count = 0
for x in range(cycle):
	if s[x] == s[x + 1]:
		count = count + 1
print(count)


n = input()
s = input()
last = 'Y'
ans = 0
for i in s:
	if i == last:
		ans += 1
	last = i
print(ans)


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


a = int(input())
b = input()
num = 0
for i in range(a):
	if i > 0 and b[i] == b[i - 1]:
		num += 1
print(num)


def input_int():
	list(map(int, input().strip().split()))

def main():
	n = int(input())
	s = input().strip()
	j = count = 0
	for i in range(1, n):
		if s[i] == s[j]:
			count += 1
		j += 1
	print(count)
main()


n = int(input())
s = input()
t = 'A'
for i in s:
	if i != t[-1]:
		t += i
print(n - (len(t) - 1))


no_of_stones = int(input())
row = input()
prev = ' '
count = 0
for i in row:
	if prev == i:
		count += 1
	else:
		prev = i
print(count)


def stones():
	n = int(input())
	(coutR, coutB, coutG, cout) = (0, 0, 0, 0)
	if n < 1 or n > 50:
		print('Bad Entry')
	else:
		s = input()
		i = 0
		while i < n - 1:
			if s[i] == 'R' and s[i + 1] == 'R':
				coutR = coutR + 1
			elif s[i] == 'B' and s[i + 1] == 'B':
				coutB = coutB + 1
			elif s[i] == 'G' and s[i + 1] == 'G':
				coutG = coutG + 1
			i = i + 1
		cout = coutR + coutB + coutG
		print(cout)
stones()


n = input()
s = input()
temp = s[0]
(j, ans) = (1, 0)
while j < len(s):
	if temp == s[j]:
		ans += 1
	else:
		temp = s[j]
	j += 1
print(ans, end='')


n = int(input())
l = input()
p = [i for i in l]
f = 0
i = 1
if len(p) != 1:
	while True:
		if p[i] == p[i - 1]:
			del p[i - 1]
			f += 1
		else:
			i += 1
		if i == len(p):
			break
print(f)


count = 0
n = int(input())
s = str(input())
for j in range(0, len(s) - 1):
	if s[j] == s[j + 1]:
		count += 1
print(count)


n = int(input())
line = input()
prev = 'c'
ans = 0
for stone in line:
	if stone == prev:
		ans += 1
	prev = stone
print(ans)


def remove(stones_str):
	res = 0
	prev = stones_str[0]
	for i in stones_str[1:]:
		if i == prev:
			res += 1
		else:
			prev = i
	return res
no_of_stones = int(input().strip())
stones_str = input().strip()
res = remove(stones_str)
print(res)


n = int(input())
a = list(input())
s = []
for i in range(1, len(a)):
	j = i - 1
	if a[j] == a[i]:
		s.append([a[i], j, i])
if len(s) == len(a):
	print(len(s) - 1)
else:
	print(len(s))


n = int(input())
m = input()
s = [m[0]]
t = m[0]
for i in range(1, n):
	if m[i] != t:
		s.append(m[i])
		t = m[i]
print(n - len(s))


n = int(input())
stones = input()
num = 0
for i in range(n - 1):
	if str(stones[i]) == str(stones[i + 1]):
		num += 1
	else:
		pass
print(num)


n = int(input())
s = input()
ind = 0
i = 0
for elem in s:
	while ind < len(s) - 1:
		if s[ind] == s[ind + 1] and ind < len(s) - 1:
			i += 1
		else:
			pass
		ind += 1
print(i)


tmp = input()
colors = input()
lastColor = colors[0]
toRemove = 0
for clr in colors[1:]:
	if clr == lastColor:
		toRemove += 1
	lastColor = clr
print(toRemove)


n = int(input())
k = input()
count = 0
i = 0
while 1:
	if i + 1 < len(k) and k[i] == k[i + 1]:
		count += 1
		k = k[:i + 1] + k[i + 2:]
	elif i + 1 < len(k) and k[i] != k[i + 1]:
		i = i + 1
	else:
		break
print(count)


n = int(input())
a = input()
v = ('R', 'G', 'B')
r = 0
g = 0
b = 0
r1 = 0
if 1 <= n <= 50:
	if len(a) == n:
		for char in a:
			if char in v:
				if char == 'R':
					if r == 0:
						r = r + 1
						g = 0
						b = 0
					else:
						r1 = r1 + 1
						g = 0
						b = 0
				elif char == 'G':
					if g == 0:
						g = g + 1
						r = 0
						b = 0
					else:
						r1 = r1 + 1
						r = 0
						b = 0
				elif b == 0:
					b = b + 1
					r = 0
					g = 0
				else:
					r1 = r1 + 1
					r = 0
					g = 0
			else:
				print('wrong format')
				break
	else:
		print('Not valid input')
else:
	print('Too long')
print(r1)


n = int(input())
s = input()
numero = 0
resultado = 0
anterior = 0
for c in s:
	if anterior == 0:
		anterior = c
		continue
	if c == anterior:
		resultado += 1
		continue
	anterior = c
print(resultado)


def stonesOnTable(s):
	count = 0
	for i in range(0, len(s) - 1):
		if s[i] == s[i + 1]:
			count = count + 1
	return count
n = int(input())
s = input()
print(stonesOnTable(s))


a = input().strip()
b = input().strip()
(i, j, count) = (0, 0, 0)
while i < int(a):
	j = i + 1
	while j < int(a):
		if b[i] == b[j]:
			count += 1
			i += 1
		else:
			break
		j += 1
	i += 1
print(count)


n = int(input())
s = input()
ct = 0
for i in range(n - 1):
	t = s[i:i + 2]
	if 'RR' == t or 'BB' == t or 'GG' == t:
		ct += 1
print(ct)


n = int(input())
b = input()
c = 0
if n > 1:
	for i in range(1, n):
		j = i - 1
		if b[i] == b[j]:
			c += 1
	print(c)
else:
	print(0)


input()
l = input()
i = 0
count = 0
while i < len(l) - 1:
	if l[i] == l[i + 1]:
		count += 1
	i += 1
print(count)


numOfStones = int(input())
stones = input()
answer = 0
for i in range(numOfStones):
	if i > 0 and stones[i] == stones[i - 1]:
		answer += 1
print(answer)


n = int(input())
s = input()
li = list(s)
l = len(li)
d = 0
for i in range(0, l, 1):
	if i == l - 1:
		break
	elif li[i] == li[-(l - (i + 1))]:
		d = d + 1
if n == d:
	print(d - 1)
else:
	print(d)


a = int(input())
b = list(input())
r = 0
for i in range(a - 1):
	if i < a - 1:
		if b[i] == b[i + 1]:
			r += 1
		elif b[i] != b[i + 1]:
			r += 0
print(r)


n = int(input())
ans = 0
arr = []
str = input()
for i in range(n):
	arr.append(str[i])
for i in range(n - 1):
	if arr[i + 1] == arr[i]:
		ans += 1
print(ans)


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


n = int(input())
s = list(input())
c = 0
i = 0
while i < len(s) - 1:
	if i == len(s) - 1:
		break
	else:
		while s[i] == s[i + 1]:
			s.remove(s[i])
			c += 1
			if i == len(s) - 1:
				break
	i += 1
print(c)


n = eval(input())
s = list(input())
m = 0
i = 0
while i < len(s) - 1:
	if s[i] == s[i + 1]:
		m = m + 1
		s.pop(i)
		i = i - 1
	i = i + 1
print(m)


n = int(input())
v = []
v.extend(input())
l = len(v)
while True:
	for i in range(len(v) - 1):
		if v[i] == v[i + 1]:
			v.pop(i + 1)
			break
	else:
		break
print(l - len(v))


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


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


n = int(input())
stones = list(input())
i = 0
cnt = 0
while n > i:
	if i != 0 and stones[i] == stones[i - 1] or (i != n - 1 and stones[i] == stones[i + 1]):
		stones.pop(i)
		n -= 1
		cnt += 1
	else:
		i += 1
print(cnt)


n = int(input())
stones = list(input())
j = 0
for i in range(0, n):
	if i != n - 1 and stones[i] == stones[i + 1]:
		j += 1
print(j)


N = int(input())
S = input()
cnt = 0
for i in range(0, N - 1):
	if S[i] == S[i + 1]:
		cnt += 1
print(cnt)


n = int(input())
col = input()
length = len(col)
num = 0
for i in range(1, length):
	if col[i - 1] == col[i]:
		num += 1
	else:
		num += 0
print(num)


s = input()
s = input()
x = 0
for i in range(1, s.__len__()):
	x += s[i] == s[i - 1]
print(x)


(_, s) = (input(), input())
count = 0
last = s[0]
for ch in s[1:]:
	if last == ch:
		count += 1
	last = ch
print(count)


n = int(input())
s = input()
c = 0
while 'RR' in s:
	s = s.replace('RR', 'R', 1)
	c += 1
while 'GG' in s:
	s = s.replace('GG', 'G', 1)
	c += 1
while 'BB' in s:
	s = s.replace('BB', 'B', 1)
	c += 1
print(c)


n = int(input())
s = input().strip()
last_s = s[0]
s_cnt = 0
cnt = 0
for i in range(1, n):
	if last_s != s[i]:
		cnt += s_cnt
		s_cnt = 0
	else:
		s_cnt += 1
	last_s = s[i]
print(cnt + s_cnt)


var = input()
size = int(var)
var = input()
ans = 0
for c in range(size - 1):
	if var[c] == var[c + 1]:
		ans += 1
print(ans)


(n, original, res) = (int(input()), input(), 1)
for i in range(n - 1):
	if original[i] != original[i + 1]:
		res += 1
print(n - res)


n = int(input())
line = input()
color = line[0]
answer = 0
for i in range(1, n):
	if line[i] == color:
		answer += 1
	else:
		color = line[i]
print(answer)


def stones_on_the_table(stones):
	i = 0
	for index in range(len(stones) - 1):
		if stones[index] == stones[index + 1]:
			i += 1
	return i
c = input()
print(stones_on_the_table(input()))


n = int(input())
a = input()
count = 0
for i in range(len(a)):
	if i + 1 >= len(a):
		break
	elif a[i] != a[i + 1]:
		count += 0
	else:
		count += 1
print(count)


n = int(input())
s = input()
assert n == len(s), 'inconsistent input!'

def conPs(s, n):
	cps = 0
	idxs = zip(range(n), range(1, n))
	for (a, b) in idxs:
		if s[a] == s[b]:
			cps += 1
	return cps
print(conPs(s, n))


n = int(input())
s = input()
sr = ''
c = 0
for i in s:
	if i != sr:
		sr = i
	else:
		c = c + 1
print(c)


c = 0
n = int(input())
a = [x for x in input()]
if n > 1:
	i = 0
	try:
		while i <= n:
			if a[i] == a[i + 1]:
				a.remove(a[i])
				i -= 1
				c += 1
			i += 1
		print(c)
	except:
		print(c)
else:
	print(0)


number = int(input())
arr = []
n = 0
str1 = str(input())
for i in str1:
	arr.append(i)
for k in range(1, len(arr)):
	if arr[k] == arr[k - 1]:
		n += 1
print(n)


leng = int(input())
str = input()
lastChar = '-'
swap = 0
for c in str:
	if c != lastChar:
		swap += 1
		lastChar = c
print(leng - swap)


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


a = int(input())
stroka = input()
i = 0
k = 0
while i < len(stroka) - 1:
	if stroka[i] == stroka[i + 1]:
		k += 1
	i += 1
print(k)


repetition = int(input())
before_stones = input()
after_stones = []
remove_stones = 0
for letter in before_stones:
	after_stones.append(letter)
for color in range(repetition):
	if color == repetition - 1:
		break
	elif after_stones[color] == after_stones[color + 1]:
		remove_stones += 1
print(remove_stones)


N = input()
S = input()
n = 0
for s in range(int(N)):
	if s != int(N) - 1:
		if S[s] == S[s + 1]:
			n += 1
print(n)


def get_n(s):
	s = list(s)
	count = 0
	for i in range(len(s) - 1):
		if s[i] == s[i + 1]:
			count += 1
	return count
n = int(input())
print(get_n(input()))


n = int(input())
S = input()
(R, B, G) = (0, 0, 0)
c = 0
for _ in S:
	if _ == 'R':
		if B:
			c += B - 1
		elif G:
			c += G - 1
		R += 1
		B = 0
		G = 0
	elif _ == 'B':
		if R:
			c += R - 1
		elif G:
			c += G - 1
		B += 1
		R = 0
		G = 0
	else:
		if B:
			c += B - 1
		elif R:
			c += R - 1
		G += 1
		R = 0
		B = 0
print(c + max(R, B, G) - 1)


t = int(input())
n = input().upper()
(h, p) = (0, 0)
for i in range(len(n)):
	if n[i] == h:
		p = p + 1
		h = n[i]
	else:
		h = n[i]
print(p)


n = int(input())
a = ''
for x in input():
	if len(a) > 0:
		if a[-1] != x:
			a += x
	else:
		a += x
print(n - len(a))


numberOfStones = int(input())
stonesColor = input()
operatoins = 0
for i in range(numberOfStones - 1):
	if stonesColor[i] == stonesColor[i + 1]:
		operatoins += 1
print(operatoins)


stonescounts = int(input())
stonescolor = input()
count = 0
for i in range(stonescounts - 1):
	if stonescolor[i] == stonescolor[i + 1]:
		count += 1
print(count)


n = int(input())
s = input()
l = [x for x in s]
c = 0
for i in range(n - 1):
	flag = 0
	while l[i] == l[i + 1]:
		flag = 1
		if l[i] == 'R':
			l[i] = 'G'
		elif l[i] == 'G':
			l[i] = 'B'
		elif l[i] == 'B':
			l[i] = 'R'
	if flag == 1:
		c += 1
print(c)


n = int(input())
stones = list(input())
i = 0
sol = 0
while i < len(stones) - 1:
	if stones[i] == stones[i + 1]:
		del stones[i + 1]
		sol += 1
	else:
		i += 1
print(sol)


from math import *
import sys, random

def nextInt():
	return int(input())

def nextStrs():
	return input().split()

def nextInts():
	return list(map(int, nextStrs()))

def main():
	n = nextInt()
	S = input()
	cnt = 0
	for i in range(len(S) - 1):
		if S[i] == S[i + 1]:
			cnt += 1
	print(cnt)
exit(main())


def solve():
	length = int(input())
	seq = [x for x in input()]
	new_seq = []
	prev = None
	i = 0
	for col in seq:
		if i == 0:
			prev = col
		else:
			if prev == col:
				new_seq.append(col)
			prev = col
		i += 1
	print(len(new_seq))
solve()


len_row = input()
color_scheme = input()
arr = list()
for i in range(int(len_row)):
	arr.append(color_scheme[i])
count = 0
for i in range(len(arr) - 1):
	if arr[i] == arr[i + 1]:
		count = count + 1
print(count)


new = int(input())
sqw = input()
c = 0
for i in range(new - 1):
	if sqw[i] == sqw[i + 1]:
		c += 1
print(c)


n = int(input())
colors = list(input())

def ordering(typ, numbers, i, pom_2):
	global pom_3
	pom_3 = pom_2
	if numbers == 1:
		return pom_3
	if colors[i] == colors[i - 1] and i > 0:
		pom_2 += 1
		i = i + 1
		pom_3 = pom_2
		if 0 < i < numbers:
			ordering(typ, numbers, i, pom_2)
	elif i < numbers - 1 and numbers > 1:
		i = i + 1
		ordering(typ, numbers, i, pom_2)
ordering(colors, n, 1, 0)
print(pom_3)


n = int(input())
str = input()
length = len(str)
while 'RR' in str or 'BB' in str or 'GG' in str:
	str = str.replace('RR', 'R')
	str = str.replace('BB', 'B')
	str = str.replace('GG', 'G')
print(length - len(str))


a = int(input())
b = input()
m = 0
c = 'none'
for i in b:
	if i == c:
		m += 1
	c = i
print(m)


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


import math
val = input()
letters = list(input())
ct = 0
for i in range(len(letters) - 1):
	if letters[i] == letters[i + 1]:
		ct += 1
print(ct)


num = int(input())
string = input()
c = 0
if num > 1:
	for idx in range(1, num):
		if string[idx] == string[idx - 1]:
			c += 1
print(c)


n = int(input())
string = input()
stones_list = []
for letter in string:
	stones_list.append(letter)
i = 0
count = 0
while i < n - 1:
	if stones_list[i] == stones_list[i + 1]:
		count += 1
	i += 1
print(count)


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


x = int(input())
y = input()
a = [l for l in y]
t = 0
i = 0
while i < len(a) - 1:
	if a[i] == a[i + 1]:
		del a[i]
		t += 1
		i = 0
	else:
		i += 1
print(t)


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


n = input()
List = list(input())
chosen_indices = []
i = 0
if len(List) == 1:
	print(0)
else:
	while i < len(List):
		if i == len(List) - 1:
			if List[i - 1] != List[i]:
				chosen_indices += [i]
			break
		chosen_indices += [i]
		adding = 0
		for j in range(i + 1, len(List)):
			if List[j] == List[i]:
				adding += 1
			else:
				break
		i += adding + 1
	print(len(List) - len(chosen_indices))


n = int(input())
s = list(input())
a0 = len(s)
a1 = 0
b1 = 0
for i in range(1, a0):
	if s[i] != s[i - 1]:
		a1 += 1
print(a0 - a1 - 1)


n = int(input())
s = input()
d = []
for i in s:
	if len(d) == 0:
		d.append(i)
	elif i != d[-1]:
		d.append(i)
print(len(s) - len(d))


x = input()
x = input()
y = []
z = 0
for ch in x:
	y.append(ch)
for i in range(len(y)):
	while i + 1 < len(y) and y[i] == y[i + 1]:
		y.pop(i + 1)
		z += 1
print(z)


import sys
import math

def pickoutsCnt(pattern):
	cnt = 0
	for x in range(1, len(pattern)):
		if pattern[x - 1] == pattern[x]:
			cnt += 1
	return cnt
pattern_length = int(input().strip())
table_pattern = input().strip()
result = pickoutsCnt(table_pattern)
print(result)


n = int(input())
st = input()
counter = 0
if n <= 1:
	print(0)
else:
	for i in range(1, n):
		if st[i] == st[i - 1]:
			counter += 1
	print(counter)


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


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


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


def deleter(mas, i):
	res = ''
	for (j, el) in enumerate(mas):
		if j != i:
			res += el
	return spliter(res)

def spliter(s):
	mas = []
	for i in range(len(s)):
		mas.append(s[i])
	return mas
s = int(input())
k = input()
i = 0
a = 0
k = spliter(k)
flag = True
while flag:
	s = len(k)
	if i + 1 < s:
		if k[i] == k[i + 1]:
			k = deleter(k, i)
			i = 0
			a += 1
		else:
			i += 1
	else:
		flag = False
print(a)


input()
stones = input()
removed = 0
i = 0
while i < len(stones) - 1:
	if stones[i] == stones[i + 1]:
		removed += 1
		j = i + 2
		whiled = False
		while j < len(stones) and stones[j] == stones[i]:
			removed += 1
			j += 1
			whiled = True
		if whiled:
			i = j - 1
	i += 1
print(removed)


n = int(input())
stones = input()
count = 0
for x in range(n - 1):
	for y in range(x + 1, x + 2):
		if stones[x] == stones[y]:
			count += 1
print(count)


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


n = int(input().strip())
s = input()
c = s[0]
ans = 0
for i in range(1, n):
	if c != s[i]:
		c = s[i]
	else:
		ans += 1
print(ans)


p = int(input())
q = input()
ans = 0
for i in range(p):
	if i < p - 1 and q[i] == q[i + 1]:
		ans += 1
print(ans)


t = int(input())
a = input()
a = list(a)
counter = 0
while counter < t - 1:
	for i in range(t - 1):
		if a[i] == a[i + 1]:
			counter += 1
		else:
			a = a
			pass
	else:
		break
print(counter)


n = int(input())
string = input()
if len(set(string)) == 1:
	print(len(string) - 1)
else:
	stack = []
	prev = string[0]
	count = 1
	for i in string[1:]:
		if i == prev:
			count += 1
		else:
			stack.append(count)
			prev = i
			count = 1
	stack.append(count)
	ans = 0
	for val in stack:
		ans += val - 1
	print(ans)


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


num = int(input())
colors = list(input())
a = 0
for i in range(1, num):
	if colors[i] == colors[i - 1]:
		a += 1
print(a)


l = int(input())
s = input()
o = [None]
for i in s:
	if i != o[-1]:
		o.append(i)
print(len(s) + 1 - len(o))


i = int(input())
a = input()
x = list()
cnt = 0
for j in range(0, i):
	x.append(a[j])
y = len(x)
for i in range(0, y - 1):
	if x[i] == x[i + 1]:
		x[i] = 'a'
		cnt += 1
print(cnt)


from math import *
n = int(input())
l = list(input())
c = 0
for i in range(0, len(l) - 1):
	if l[i] == l[i + 1]:
		c += 1
print(c)


k = input()
n = input()
sum = 0
x = 1
while x < len(n):
	if n[x - 1] == n[x]:
		sum += 1
		n = n[:x] + n[x + 1:]
		x -= 1
	x += 1
print(sum)


p = input()
s = input()
c = 0
for x in range(len(s) - 1):
	if s[x] == s[x + 1]:
		c += 1
print(c)


N = int(input())
frase = input()
cont = 0
for i in range(1, N):
	if frase[i] == frase[i - 1]:
		cont += 1
print(cont)


x = int(input())
a = input()
b = ''
res = 0
for i in a:
	if len(b) == 0:
		b = b + i
	elif i == b[-1]:
		res = res + 1
		b = b + i
	else:
		b = b + i
print(res)


n = int(input())
x = input()
total = 0
for a in range(n - 1):
	if x[a] == x[a + 1]:
		total += 1
print(total)


n = input
n()
m = n()
print(sum((p == q for (p, q) in zip(m[1:], m))))


n = int(input())
inputstring = input()
count = 0
var = inputstring[0]
for i in range(1, n):
	if var == inputstring[i]:
		count += 1
		var = inputstring[i]
	else:
		var = inputstring[i]
print(count)


n = int(input())
a = [i for i in input()]
s = True
while s:
	s = False
	for i in range(len(a) - 1):
		if a[i] == a[i + 1]:
			del a[i + 1]
			s = True
			break
print(n - len(a))


n = eval(input())
x = input()
i = 0
c = 0
while i < n - 1:
	if x[i] == x[i + 1]:
		c += 1
	i += 1
print(c)


n = int(input())
s = input()
mas = []
for i in range(1, len(s)):
	if s[i] == s[i - 1]:
		mas.append(s[i])
print(len(mas))


n = int(input())
stones = input()
res = [stones[0]]
for (i, stone) in enumerate(stones):
	if i and stone != stones[i - 1]:
		res.append(stone)
print(len(stones) - len(res))


ok = int(input())
hahaha = str(input())
boomer = 0
for i in range(ok - 1):
	if hahaha[i] == hahaha[i + 1]:
		boomer += 1
print(boomer)


num = input()
str = input()
print(int(num) - int(str.count('RG')) - int(str.count('GR')) - 1 - int(str.count('GB')) - int(str.count('BG')) - int(str.count('RB')) - int(str.count('BR')))


a = input()
c = input()
b = []
i = 1
t = 0
b.append(c[0])
while i < len(c):
	if b[i - 1] in c[i]:
		t = t + 1
	b.append(c[i])
	i = i + 1
print(t)


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


n = int(input())
a = input()
num = 0
for i in range(n - 1):
	if a[i:i + 2] in ['RR', 'GG', 'BB']:
		num += 1
print(num)


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


n = int(input())
row = input()
duplicates = 0
prev = None
for ch in row:
	if prev == ch:
		duplicates += 1
	prev = ch
print(duplicates)


n = input()
word = input()
letter = word[0]
count = 0
for i in word[1:]:
	if letter == i:
		count += 1
	letter = i
print(count)


import re
x = int(input())
s = input()
length = len(s)
while True:
	if 'RR' not in s and 'BB' not in s and ('GG' not in s):
		break
	else:
		s = re.sub('RR', 'R', s)
		s = re.sub('GG', 'G', s)
		s = re.sub('BB', 'B', s)
print(length - len(s))


n = int(input())
A = input()
k = 0
c = 0
if n == len(A):
	while n - 1 > k:
		if A[k] == A[k + 1]:
			c = c + 1
		k = k + 1
print(c)


def removestones(mystr):
	n = len(mystr)
	i = 0
	(cr, cg, cb) = (0, 0, 0)
	while i < n:
		if i < n and mystr[i] == 'R':
			i += 1
			while i < n and mystr[i] == 'R':
				cr += 1
				i += 1
		if i < n and mystr[i] == 'G':
			i += 1
			while i < n and mystr[i] == 'G':
				cg += 1
				i += 1
		if i < n and mystr[i] == 'B':
			i += 1
			while i < n and mystr[i] == 'B':
				cb += 1
				i += 1
	print(cr + cb + cg)
n = input()
mystr = input()
removestones(mystr)


n = int(input())
s = input()
res = 0
for (i, c) in enumerate(s):
	if i > 0 and c == s[i - 1]:
		res += 1
print(res)


input()
a = input()
r = 0
for i in range(1, len(a)):
	if a[i - 1] == a[i]:
		r += 1
print(r)


n = int(input())
s = list(input())
ans = ''
for i in range(len(s)):
	if i == 0:
		ans += s[0]
	elif s[i] == s[i - 1]:
		ans += ''
	else:
		ans += s[i]
print(len(s) - len(ans))


import sys
import collections
import math
import functools
import itertools
import bisect
import operator
import heapq
import random
true = True
false = False
null = None
tcid = 0

def ceil(a, b):
	ans = a // b
	if a % b != 0:
		ans += 1
	return ans

def perr(*args, **kwargs):
	print(*args, file=sys.stderr, **kwargs)

def line():
	ln = sys.stdin.readline().strip()
	if ln == '':
		sys.exit()
	return ln

def lines(n):
	return [line() for i in range(n)]

def split(ln=None):
	return (ln or line()).split()

def parse(*parsers):
	return list(map(lambda p, w: p(w), parsers, split()))

def nums(o=None):
	if o is not None:
		if isinstance(o, int):
			o = lines(o)
		elif isinstance(o, str):
			o = split(o)
	return list(map(int, o or split()))

def num():
	return int(line())

def solve(tcid=1):
	n = num()
	s = line()
	ans = 0
	for zz in range(n - 1):
		if s[zz] == s[zz + 1]:
			ans += 1
	print(ans)
while true:
	tcid += 1
	solve(tcid)


n = int(input())
s = str(input())
li = [char for char in s]
count = 0
for i in range(0, len(li) - 1):
	if li[i] == li[i + 1]:
		count = count + 1
print(count)


n = int(input())
st = input()
w = st[0]
out = -1
for i in range(n):
	if st[i] == w:
		out = out + 1
	w = st[i]
print(out)


x = int(input())
y = [i for i in str(input())]
z = y[:]
z.append(0)
n = 0
for i in range(x):
	if z[i] == z[i + 1]:
		n += 1
print(n)


N = int(input())
stones = list(input())
count = 0
for s in range(1, len(stones)):
	if stones[s] == stones[s - 1]:
		count += 1
print(count)


n = int(input())
s = input()
a = ''
for i in range(n - 1):
	if s[i] == s[i + 1]:
		a += s[i]
print(len(a))


n = int(input())
warna = input()
hasil = 0
data = []
total = 0
if n >= 1 and n <= 50:
	for i in range(n):
		if i < len(warna) - 1:
			if warna[i] == warna[i + 1]:
				hasil += 1
				continue
			else:
				data += [hasil]
				hasil = 0
		data += [hasil]
	for i in data:
		total += i
	print(total)


import sys

def solution():
	result = 0
	input()
	line = input()
	while 'RR' in line:
		result += line.count('RR')
		line = line.replace('RR', 'R')
	while 'BB' in line:
		result += line.count('BB')
		line = line.replace('BB', 'B')
	while 'GG' in line:
		result += line.count('GG')
		line = line.replace('GG', 'G')
	print(result)
solution()


n = input()
string = input()
i = 0
delete = 0
while i < len(string) - 1:
	j = i + 1
	while j < len(string) and string[j] == string[i]:
		delete += 1
		j += 1
	i = j
print(delete)


n = int(input())
a = input()
s = list([i for i in a])
x = []
for i in range(n - 1):
	if s[i] == s[i + 1]:
		x.append(s[i])
print(len(x))


import math
from collections import defaultdict
from collections import Counter
import itertools

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


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


n = int(input().strip())
s = input().strip()
p = 'X'
ans = 0
for c in s:
	if p == c:
		ans += 1
	p = c
print(ans)


def get_min_stones_to_remove(stones: 'str', acc: 'int') -> 'int':
	return acc if len(stones) == 1 or not stones else get_min_stones_to_remove(stones[1:], acc + 1) if stones[0] == stones[1] else get_min_stones_to_remove(stones[1:], acc)

def main():
	_ = input()
	print(get_min_stones_to_remove(input(), 0))
main()


n = int(input())
s = input()
c = 1
p = 0
while c != len(s):
	c = 1
	for i in range(0, len(s) - 1):
		if s[i] == s[i + 1]:
			s = s[:i] + s[i + 1:]
			p += 1
			break
		else:
			c += 1
print(p)


n = int(input())
s = input()
(r, b, g, t) = (0, 0, 0, 0)
if n < 1 or n > 50:
	print('Bad Entry')
else:
	i = 0
	while i < n - 1:
		if s[i] == 'R' and s[i + 1] == 'R':
			r += 1
		elif s[i] == 'B' and s[i + 1] == 'B':
			b += 1
		elif s[i] == 'G' and s[i + 1] == 'G':
			g += 1
		i += 1
	t = r + b + g
	print(t)


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


n = int(input())
colors = input()
i = 0
solution = 0
removed = 1
while i < n - removed:
	if colors[i] == colors[i + 1]:
		solution += 1
		colors = colors[:i] + colors[i + 1:]
		removed += 1
		i = -1
	i += 1
print(solution)


n = int(input())
a = list(input())
r = 0
g = 0
b = 0
for i in range(n - 1):
	if a[i + 1] == a[i] == 'R':
		r = r + 1
	if a[i + 1] == a[i] == 'G':
		g = g + 1
	if a[i + 1] == a[i] == 'B':
		b = b + 1
print(r + g + b)


N = int(input())
s = input()
print(sum((int(c == d) for (c, d) in zip(s, s[1:]))))


a = int(input())
b = str(input())
last_numb = b[0]
j = -1
for i in b:
	if i == last_numb:
		j += 1
	else:
		last_numb = i
print(j)


n = int(input())
a = list(input())
c = []
for i in range(n - 1):
	if a[i] == a[i + 1]:
		c.append(i)
print(len(c))


x = int(input())
s = input()
l = list(s)
c = 0
l.append('k')
for i in range(0, x):
	if l[i] == l[i + 1]:
		c += 1
print(c)


eif = input()
p = input()

def rows(i):
	itz = len(i)
	count = 0
	for n in range(0, itz - 1):
		if i[n] == i[n + 1]:
			count += 1
		else:
			continue
	return count
print(rows(p))


n = int(input())
while True:
	p = input()
	if len(p) == n:
		break
c = 0
for i in range(len(p) - 1):
	if p[i] == p[i + 1]:
		c += 1
print(c)


d = int(input())
s = input()
list = []
for i in range(len(s)):
	list.append(s[i])
a = list
ans = 0
p = True
while True:
	p = True
	for i in range(len(a) - 1):
		if a[i + 1] == a[i]:
			del a[i]
			ans += 1
			p = False
			break
	if p:
		break
print(ans)


length = int(input())
seq = input()
count = 0
lastChar = seq[0]
for i in range(1, length):
	if lastChar == seq[i]:
		count += 1
	lastChar = seq[i]
print(count)


from functools import reduce
countStr = input()
count = int(countStr)
colorPattern = input()
lastChar = None
countSwitch = 0
for ch in colorPattern:
	if lastChar is None or ch != lastChar:
		lastChar = ch
		countSwitch += 1
print(len(colorPattern) - countSwitch)


(n, x) = (int(input()), input())
stack = []
cunt = 0
for i in x:
	if stack == [] or i == stack[-1]:
		stack.append(i)
	else:
		cunt += len(stack) - 1
		stack = [i]
if stack:
	cunt += len(stack) - 1
print(cunt, sep='')


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


class S:

	def solve(self, n, stones):
		c = 0
		for i in range(1, n):
			if stones[i] == stones[i - 1]:
				c += 1
		return c
n = int(input())
stones = input()
s = S()
print(s.solve(n, stones))


init = int(input())
in_string = input()
total = 0
arr = ['a'] * init
for i in range(0, init):
	arr[i] = in_string[i:i + 1]
for i in range(0, init - 1):
	if arr[i] == arr[i + 1]:
		arr[i] = 'gone'
		total += 1
print(total)


n = int(input())
x = input()
y = []
for i in range(n):
	if i == 0:
		y.append(x[i])
	elif x[i] != x[i - 1]:
		y.append(x[i])
print(n - len(y))


def checker(string):
	removable = 0
	list_str = list(string)
	for i in range(0, len(list_str) - 1):
		if list_str[i] == list_str[i + 1]:
			removable += 1
		else:
			pass
	return removable
n = int(input())
string_input = input()
out = checker(string_input)
print(out)


n = int(input())
string = input()
r = string.count('R')
g = string.count('G')
b = string.count('B')
if n == r or n == g or n == b:
	print(n - 1)
else:
	l = 1
	c = 0
	for i in string:
		if l < len(string):
			if i == string[l]:
				c += 1
		l += 1
	print(c)


n_str = input()
input_str = input()
count = 0
for i in range(0, int(n_str) - 1):
	if input_str[i] == input_str[i + 1]:
		count += 1
print(count)


no_of_stones = int(input())
stone_sequence = input()
count = 0
if len(stone_sequence) == 1:
	print(0)
else:
	for i in range(len(stone_sequence) - 1):
		if stone_sequence[i] == stone_sequence[i + 1]:
			count += 1
	print(count)


n = int(input())
str1 = input()
count = 0
for i in range(len(str1)):
	if i == 0:
		continue
	elif str1[i] == str1[i - 1]:
		count = count + 1
print(count)


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


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


number = int(input(''))
count = 0
TEMP = number - 1
mit = input('')
for i in range(TEMP):
	if mit[i] == 'B' and mit[i + 1] == 'B':
		count = count + 1
	elif mit[i] == 'G' and mit[i + 1] == 'G':
		count = count + 1
	elif mit[i] == 'R' and mit[i + 1] == 'R':
		count = count + 1
	else:
		continue
print(count)


n = input()
i = input()
c = 0
a = i[0]
for e in i[1:]:
	if e == a:
		c += 1
	a = e
print(c)


t = int(input())
s = input()
cnt = 0
for i in range(t):
	if i == 0:
		continue
	elif s[i] == s[i - 1]:
		cnt += 1
print(cnt)


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


ip = int(input())
stones = list(map(str, input()))
count = 0
i = 0
for i in range(ip - 1 - i):
	if stones[i] == stones[i + 1]:
		count += 1
print(count)


NumberOfStones = int(input())
ColorsOfStones = input()
removedStones = 0
while ColorsOfStones.find('RR') != -1:
	ColorsOfStones = ColorsOfStones.replace('RR', 'R', 1)
	removedStones += 1
while ColorsOfStones.find('GG') != -1:
	ColorsOfStones = ColorsOfStones.replace('GG', 'G', 1)
	removedStones += 1
while ColorsOfStones.find('BB') != -1:
	ColorsOfStones = ColorsOfStones.replace('BB', 'B', 1)
	removedStones += 1
print(removedStones)


def stones():
	n = int(input().strip())
	s = list(input().strip())
	lastChr = s[0]
	count = 0
	for c in s[1:]:
		if c == lastChr:
			count += 1
		lastChr = c
	return count
print(stones())


hjsfdhjgs = input()
st = list(str(input()))
o = 0
for i in range(1, len(st)):
	if st[i] == st[i - 1]:
		o += 1
print(o)


read = int(input())
string = input()
list1 = list(string)
list2 = []
list2.append(list1[0])
for i in range(read):
	if list1[i] != list2[-1]:
		list2.append(list1[i])
print(len(list1) - len(list2))


x = input()
a = input()
R = 0
G = 0
B = 0
if a[0] == 'R':
	R = 1
if a[0] == 'G':
	G = 1
if a[0] == 'B':
	B = 1
cnt = 0
for i in range(1, len(a)):
	if a[i] == a[i - 1]:
		if a[i] == 'R':
			R += 1
		if a[i] == 'G':
			G += 1
		if a[i] == 'B':
			B += 1
	else:
		if a[i - 1] == 'R':
			p = R - 1
			R = 0
		if a[i - 1] == 'G':
			p = G - 1
			G = 0
		if a[i - 1] == 'B':
			p = B - 1
			B = 0
		if a[i] == 'R':
			R = 1
		if a[i] == 'G':
			G = 1
		if a[i] == 'B':
			B = 1
		cnt += p
cnt += R + B + G - 1
print(cnt)


def solve(s):
	count = 0
	for i in range(len(s)):
		if i != len(s) - 1:
			if s[i] == s[i + 1]:
				count += 1
	print(count)
x = int(input())
y = input()
solve(y)


n = int(input())
string = input()
count = 0
while 'RR' in string or 'BB' in string or 'GG' in string:
	if 'RR' in string:
		string = string.replace('RR', 'R', 1)
		count += 1
	elif 'BB' in string:
		string = string.replace('BB', 'B', 1)
		count += 1
	elif 'GG' in string:
		string = string.replace('GG', 'G', 1)
		count += 1
print(count)


n = int(input().strip())
s = input().strip()
sol = 0
for i in range(1, n):
	x = s[i - 1] + s[i]
	if x in ['RR', 'GG', 'BB']:
		sol += 1
print(sol)


n = int(input())
m = list(map(str, input().strip()))
c = 0
m.append(-1)
for i in range(n):
	if m[i] == m[i + 1]:
		c = c + 1
print(c)


n = int(input())
lst = input()
temp = lst[0]
count = -1
for x in lst:
	if x == temp:
		count += 1
	else:
		temp = x
print(count)


n = int(input())
s = input()
total = 0
index = 0
while index < n:
	curr = s[index]
	count = 0
	while index < n and s[index] == curr:
		count += 1
		index += 1
	total += max(0, count - 1)
print(total)


def cnt(x, n):
	count = 0
	i = 0
	while i < n:
		for j in range(i + 1, n):
			if x[i] == x[j]:
				count += 1
				x[j] = ' '
				if j == n - 1:
					i = j - 1
					return count
			else:
				i = j - 1
				break
		i += 1
	return count
n = int(input())
s = input()
x = list(s)
print(cnt(x, n))


r = 'R'
b = 'B'
g = 'G'
num = input()
a = input()
lst = []
count = 0
for i in range(0, len(a) - 1):
	if a[i] == r and a[i + 1] == r or (a[i] == b and a[i + 1] == b) or (a[i] == g and a[i + 1] == g):
		count += 1
print(count)


t = int(input())
n = input()
l = list(n)
x = 0
for i in range(t):
	if i <= t - 2:
		if l[i] == l[i + 1]:
			x += 1
		else:
			pass
print(x)


n = int(input())
string = input()
count = 0
if len(string) <= 1:
	print(count)
else:
	for j in range(len(string) - 1):
		if string[j] == string[j + 1]:
			count += 1
			continue
		else:
			continue
	print(count)


stonesNumber = int(input())
stonesColor = input()
finalColor = []
tmpColor = ''
for i in stonesColor:
	if i != tmpColor:
		finalColor.append(i)
		tmpColor = i
print(len(stonesColor) - len(finalColor))


n = input()
str = input()
ch = str[0]
res = -1
for i in str:
	if ch == i:
		res += 1
	ch = i
print(res)


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


n = int(input())
s = list(input())
sum = 0
for i in range(n - 1):
	if s[i] != s[i + 1]:
		continue
	else:
		sum += 1
print(sum)


n = int(input())
a = input()
t = list(a)
red = 0
blue = 0
green = 0
c = 0
for i in t[0:]:
	if i == 'R':
		blue = 0
		green = 0
		red += 1
		if red > 1:
			c += 1
			red -= 1
	if i == 'B':
		red = 0
		green = 0
		blue += 1
		if blue > 1:
			c += 1
			blue -= 1
	if i == 'G':
		blue = 0
		red = 0
		green += 1
		if green > 1:
			c += 1
			green -= 1
print(c)


length = int(input())
stones = input()
a = [i for i in stones]
count = 0
for i in range(length - 1):
	if a[i] == a[i + 1]:
		count += 1
print(count)


a = int(input(''))
arr = input('')
i = 0
count = 0
check = False
while check is False:
	if i == len(arr) - 1:
		break
	if arr[i] == arr[i + 1]:
		count += 1
		arr = arr[0:i] + arr[i + 1:len(arr)]
	else:
		i += 1
print(count)


n = int(input())
file = input()
tirarR = sum((file[i:].startswith('RR') for i in range(n)))
tirarG = sum((file[i:].startswith('GG') for i in range(n)))
tirarB = sum((file[i:].startswith('BB') for i in range(n)))
soma = tirarR + tirarB + tirarG
print(soma)


n = int(input())
s = input()
lst = []
c = 0
for i in range(n):
	lst.append(s[i])
for i in range(n - 1):
	if s[i] == s[i + 1]:
		lst.remove(s[i])
		c += 1
print(c)


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


a = input()
n = 0
colors = [i for i in input()]
for i in range(len(colors)):
	if i + 1 != len(colors) and colors[i] == colors[i + 1]:
		n += 1
print(n)


n = int(input().strip())
str = input().lower().strip()
ct = 0
pre = None
for i in str[:n]:
	if pre == None:
		pre = i
		continue
	if i == pre:
		ct += 1
	else:
		pre = i
print(ct)


n = int(input())
str1 = input()
c = str1[0]
count = 0
for i in str1[1:]:
	if i == c:
		count += 1
	else:
		c = i
print(count)


b = int(input())
a = input()
a = a.lower()
c = 0
for i in range(1, len(a)):
	if a[i] == a[i - 1]:
		c += 1
	else:
		pass
print(c)


n = int(input())
s = list(input())
count = 0
flag = False
for i in range(0, n - 1):
	if s[i] == s[i + 1]:
		flag = True
if flag == True:
	for i in range(1, n - 1):
		if s[i] != s[i - 1] and s[i] != [i + 1]:
			continue
		else:
			count = count + 1
	if s[len(s) - 1] == s[len(s) - 2]:
		count = count + 1
print(count)


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


n = int(input())
s = input()
k = len(s)
while s.count('RR'):
	s = 'R'.join(s.split('RR'))
while s.count('GG'):
	s = 'G'.join(s.split('GG'))
while s.count('BB'):
	s = 'B'.join(s.split('BB'))
print(k - len(s))


number_of_stones = int(input())
stones = list(input())
prev_stone = ''
count = 0
for stone in stones:
	if stone == prev_stone:
		count += 1
	prev_stone = stone
print(count)


n = int(input())
s = input()
res = 0
for i in range(n - 1):
	if s[i] == 'R' and s[i + 1] == 'R':
		res += 1
	if s[i] == 'G' and s[i + 1] == 'G':
		res += 1
	if s[i] == 'B' and s[i + 1] == 'B':
		res += 1
print(res)


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


numberOfStones = int(input())
inputString = input()
arrangement = list(inputString)
modification = 0
for i in range(1, numberOfStones):
	if arrangement[i] == arrangement[i - 1]:
		modification += 1
print(modification)


n = int(input())
a = input()
list = []
c1 = len(a)
for i in range(n - 1):
	if a[i] != a[i + 1]:
		list.append(a[i])
c2 = len(list)
print(c1 - c2 - 1)


count = int(input())
stone = input()
c = 0
for i in range(count):
	if i < len(stone) - 1:
		if stone[i] == stone[i + 1]:
			c += 1
print(c)


def chek_and_do(string, number):
	if number == 0:
		return 0
	else:
		count = 0
		for i in range(0, number - 1):
			if string[i] == string[i + 1]:
				count += 1
		return count
n = int(input().strip())
s = input().strip()
print(chek_and_do(s, n))


n = int(input())
seq = input()
k = seq[0]
ans = 0
for x in seq[1:]:
	if x == k:
		ans += 1
	k = x
print(ans)


numberOfStones = int(input())
string = input()
count = 0
if len(string) == 1:
	print('0')
else:
	for index in range(len(string) - 1):
		if string[index] == string[index + 1]:
			count += 1
	print(count)


x = int(input())
stones = list(input())
count = 0
for i in range(0, x):
	if i == x - 1:
		pass
	elif stones[i] == stones[i + 1]:
		count += 1
print(count)


n = int(input())
S = input()
ret = 0
for x in range(n - 1):
	if S[x] == S[x + 1]:
		ret += 1
print(ret)


m = input()
n = input()
count = 0

def take(n):
	global count
	for i in range(len(n)):
		if n[i] == n[i - 1] and i > 0:
			x = n[:i - 1] + n[i:]
			count += 1
			take(x)
			break
	return count
print(take(n))


n = int(input())
s = input()
colors = list(s)
answer = int()
i = int()
while i < n - 1:
	if colors[i] == colors[i + 1]:
		answer += 1
	i += 1
print(answer)


a = int(input())
st = input()
n = 0
for i in range(a - 1):
	if st[i] == st[i + 1]:
		n += 1
print(n, end='')


n = int(input(''))
s = input('')
curr = ''
prev = ''
counter = 0
for i in range(0, n):
	curr = s[i]
	if curr == prev:
		counter += 1
	prev = curr
print(counter)


stones = int(input())
colours = input()
new_string = colours[0]
for i in colours:
	if i != new_string[-1]:
		new_string += i
print(len(colours) - len(new_string))


a = input()
s = input()
p = s[0]
st = 0
for l in s[1:]:
	if l == p:
		st += 1
	p = l
print(st)


y = int(input())
x = str(input())
z = 0
for i in range(y):
	if x[i] == x[min(i + 1, y - 1)]:
		z += 1
print(z - 1)


X = input('')
A = input('')
res = sum([1 for i in range(len(A) - 1) if A[i] == A[i + 1]])
print(res)


N = int(input())
x = input()
out = 0
for i in range(len(x) - 1):
	if x[i] == x[i + 1]:
		out += 1
print(out)


n = int(input())
str = input()
a = str.count('RG')
b = str.count('BG')
c = str.count('RB')
d = str.count('GR')
e = str.count('GB')
f = str.count('BR')
num = a + b + c + d + e + f
print(n - 1 - num)


N = int(input())
str1 = input()
a = -1
y = 0
while a < N - 2:
	a += 1
	if str1[a] == str1[a + 1]:
		y += 1
print(y)


number_of_stones = int(input())
stones = input()
prev = ''
count = 0
for x in range(number_of_stones):
	if stones[x] == prev:
		count += 1
	prev = stones[x]
print(count)


n = input()
a = input().strip()
l = []
for i in range(len(a)):
	l.append(a[i])
count = 0
for i in range(len(a) - 1):
	if a[i] == a[i + 1]:
		count = count + 1
print(count)


a = int(input())
string_color = input()
final_arr = []
count = 1
for i in range(1, a):
	if string_color[i] != string_color[i - 1]:
		count += 1
print(a - count)


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


a = int(input())
s = input()
lst = list(s)
lst1 = lst[1:a]
p = 0
q = 0
for i in lst1:
	if i == lst[q]:
		p += 1
	q += 1
print(p)


n = int(input())
a = input()
count = 0
for i in range(len(a) - 1):
	if a[i] == a[i + 1]:
		count += 1
	else:
		continue
print(count)


def stones(string):
	count = 0
	for i in range(len(string) - 1):
		if string[i] == string[i + 1]:
			count = count + 1
	return count
n = int(input())
string = input()
print(stones(string))


def diff_stones():
	n = int(input())
	s = [c for c in input()]
	i = 0
	c = 0
	while i < n - 1:
		if s[i] == s[i + 1] and s[i] != '.':
			s[i] = '.'
			c = c + 1
		i = i + 1
	return c
print(diff_stones())


n = int(input())
b = str(input())
a = []
for i in range(n):
	a.append(b[i])
count = 0
i = 0
while i < n - 1:
	if a[i] == a[i + 1]:
		count += 1
		a.pop(i + 1)
		n -= 1
	else:
		i += 1
print(count)


itr = int(input())
count = 0
clr = input()
clr1 = clr
for i in range(0, itr - 1):
	i2 = i + 1
	if clr[i] == clr[i2]:
		count += 1
print(count)


n = int(input())
l = input()
br = 0
for i in range(n - 1):
	a = l[i]
	b = l[i + 1]
	if a == b:
		br += 1
print(br)


num = int(input())
string = input()
answer = 0
for i in range(0, num - 1):
	if string[i] == string[i + 1]:
		answer += 1
print(answer)


import re
input()
x = re.findall('(.)(\\1+)', input())
print(sum([len(t[1]) for t in x]))


def solve(s):
	count = 0
	for i in range(1, len(s)):
		if s[i] == s[i - 1]:
			count += 1
	return count
t = int(input())
s = input()
print(solve(s))


n = input()
str = input()
str = list(str)
str1 = str.copy
i = 0
while True:
	if len(str) == 1 or len(str) - 1 == i:
		break
	if str[i + 1] == str[i]:
		str.pop(i)
		i = 0
	else:
		i += 1
print(int(n) - len(str))


a = input()
a = input()
cnt = 0
for i in range(len(a) - 1):
	if a[i] == a[i + 1]:
		cnt += 1
print(cnt)


numb = int(input())
pack = input()
res = 0
for k in range(1, numb):
	if pack[k - 1] == pack[k]:
		res += 1
print(res)


num = int(input())
colo = input()
result = 0
for i in range(num - 1):
	if colo[i] == colo[i + 1]:
		result = result + 1
print(result, sep='')


n = int(input())
stones = list(input())
removed = 0
for x in range(len(stones) - 1, 0, -1):
	if stones[x] == stones[x - 1]:
		del stones[x]
		removed += 1
print(removed)


n = int(input())
srt = input()
li = list(srt)
count = 0
x = 0
for x in range(n - 1):
	if li[x] == li[x + 1]:
		count += 1
print(count)


n = int(input())
s = input()
last = ''
result = 0
for i in s:
	if last == '' or last != i:
		result += 1
		last = i
print(n - result)


n = int(input())
s = input()
count = 0
for (i, j) in zip(s, s[1:]):
	if i == j:
		count += 1
print(count)


s = input()
s = input()
ans = 0
lst = '+'
for i in s:
	if i != lst:
		ans += 1
		lst = i
print(len(s) - ans)


n = int(input())
a = input()
li = []
for each in a:
	li.append(each)
count = 0
for i in range(1, n):
	if li[i] == li[i - 1]:
		count += 1
print(count)


def Stones_on_the_Table():
	_ = input()
	string = list(input())
	color_old = ''
	color_old_old = ''
	take = 0
	for color in string:
		if color == color_old:
			take += 1
		else:
			color_old = color
	print(take)
	return
Stones_on_the_Table()


N = int(input())
s = str(input())
zero = 0
for num in range(N - 1):
	if s[num] == s[num + 1]:
		zero += 1
print(zero)


try:
	n = int(input())
	m = input()
	i = 0
	c = 0
	while i < len(m) - 1:
		if m[i] == m[i + 1]:
			while m[i] == m[i + 1]:
				i += 1
				c += 1
				if i == len(m) - 1:
					break
		else:
			i += 1
	print(c)
except:
	pass


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


def Solve(stones):
	num = 0
	currentValue = 'X'
	for stone in stones:
		if stone == currentValue:
			num += 1
		currentValue = stone
	return num

def printSolve(func):

	def doWork():
		stones = func()
		output = Solve(stones)
		print(output)
	return doWork

@printSolve
def makeStones():
	numberOfStones = int(input())
	stones = list(input())
	return stones
makeStones()


number = int(input())
colors = input()
quantity = 0
left = colors[0]
for x in range(1, len(colors)):
	if colors[x] == left:
		quantity += 1
	else:
		left = colors[x]
print(quantity)


count = 0
a = 0
b = 0
c = 0
n = int(input())
stones = input()
length = len(stones)
for i in range(length):
	if a <= length - 2:
		a = a + 1
		if stones[i] == 'R':
			if stones[a] == 'R':
				count += 1
for k in range(length):
	if b <= length - 2:
		b = b + 1
		if stones[k] == 'B':
			if stones[b] == 'B':
				count += 1
for l in range(length):
	if c <= length - 2:
		c = c + 1
		if stones[l] == 'G':
			if stones[c] == 'G':
				count += 1
print(count)


n = int(input())
x = input()
s = []
for k in x:
	s.append(k)
c = 0
i = 1
while i < n:
	if s[i] == s[i - 1]:
		c += 1
	i += 1
print(c)


x = input()
x = input()
current_symbol = x[0]
run_length = 0
stones_to_remove = 0
for i in x:
	if i == current_symbol:
		run_length += 1
	else:
		stones_to_remove += run_length - 1
		current_symbol = i
		run_length = 1
stones_to_remove += run_length - 1
print(stones_to_remove)


n = int(input())
stone = list(str(input()).upper())
count = 0
if 1 <= n <= 50:
	for elem in range(0, len(stone) - 1):
		if stone[elem] == stone[elem + 1]:
			count += 1
	print(count)


stone_nums = int(input())
stone_list = input()
count = 0
if len(stone_list) != stone_nums:
	exit(1)
for i in range(1, len(stone_list)):
	if stone_list[i] == stone_list[i - 1]:
		count += 1
print(count)


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


n = int(input())
stones = input()
min = 0
color = str()
for i in range(n):
	if i == 0:
		color = stones[i]
	elif stones[i] == color:
		min += 1
	else:
		color = stones[i]
print(min)


number_of_stones = int(input())
stone = input()
count = 0
for i in range(0, number_of_stones - 1):
	if stone[i] == stone[i + 1]:
		count += 1
print(count)


numStones = int(input())
Stones = input()
listStones = list()
for i in range(0, numStones):
	listStones.append(Stones[i])
sameNeighbours = 0
for i in range(0, numStones - 1):
	if listStones[i] == listStones[i + 1]:
		sameNeighbours += 1
print(sameNeighbours)


def solve(s):
	counter = 0
	for i in range(len(s) - 1):
		if s[i] == s[i + 1]:
			counter += 1
	return counter
n = int(input())
ss = input()
print(solve(ss))


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


def min_stones_takeout(stone_arr):
	count = 0
	first = 0
	second = first + 1
	n = len(stone_arr)
	while second <= n - 1:
		if stone_arr[first] == stone_arr[second]:
			count += 1
			second += 1
		else:
			first = second
			second += 1
	print(count)

def read_line():
	numCols = input()
	colors = input()
	cols = [ch for ch in colors]
	return cols
cols = read_line()
min_stones_takeout(cols)


f = input()
r = input()
o = 0
for e in range(1, len(r)):
	if r[e - 1] == r[e]:
		o = o + 1
print(o)


n = int(input())
s = list(input()[:n])
from itertools import groupby
c = [sum((1 for _ in group)) for (_, group) in groupby(s)]
a = []
for i in c:
	if i > 1:
		a.append(i - 1)
print(sum(a))


numStones = int(input())
s = input()
count = 0
for i in range(0, len(s) - 1):
	if s[i] == s[i + 1]:
		s.replace(s[i + 1], '')
		count += 1
print(count)


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


n = int(input())
s = input()
l = 0
ml = 0
lch = None
for ch in s:
	if lch == None:
		lch = ch
		l = 1
	elif lch == ch:
		l = l + 1
	else:
		lch = ch
		ml = ml + l - 1
		l = 1
ml = ml + l - 1
print(ml)


n = int(input())
s = input()
i = 0
iteration = 0
for ss in s:
	if iteration == n - 1:
		print(i)
		break
	if ss == s[iteration + 1]:
		i += 1
	if ss != s[iteration + 1]:
		i += 0
	iteration = iteration + 1


size = int(input())
q = list(input())
i = 0
m = 0
if size != 1:
	while i < size:
		if ord(q[i]) == ord(q[i + 1]):
			m += 1
			i += 1
		else:
			i += 1
		if i == size - 1:
			break
	print(m)
else:
	print('0')


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


def split_lst(length, order):
	new_lst = []
	for x in range(int(length)):
		new_lst.append(order[x])
	return new_lst

def stone_clr(new_lst):
	new_lst2 = []
	new_lst2.append(new_lst[0])
	counter = 0
	for x in range(len(new_lst)):
		if new_lst[x] != new_lst2[counter]:
			new_lst2.append(new_lst[x])
			counter += 1
	final = len(new_lst) - len(new_lst2)
	return final
a = split_lst(input(), input())
b = stone_clr(a)
print(b)


num = int(input())
stones = input()
ans = 0
for i in range(num - 1):
	if stones[i] == 'R' and stones[i + 1] == 'R':
		ans += 1
	elif stones[i] == 'G' and stones[i + 1] == 'G':
		ans += 1
	elif stones[i] == 'B' and stones[i + 1] == 'B':
		ans += 1
print(ans)


n = int(input())
list = [i for i in input()][:n]
b = ''
c = 0
for item in list:
	if item == b:
		c += 1
	b = item
print(c)


def countMinimum():
	numColors = int(input())
	colors = input()
	result = defineCounter(colors, numColors)
	printToConsole(result)

def defineCounter(colors, numColors):
	lenghtColors = numColors
	while len(colors) == lenghtColors:
		counter = 0
		for i in range(len(colors) - 1):
			if colors[i] == colors[i + 1]:
				counter += 1
		return counter

def printToConsole(result):
	print(result)
countMinimum()


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


(n, rocks) = (int(input()), str(input()))
if n == 1:
	print(0)
else:
	temp = rocks[0]
	result = 0
	for i in range(1, n):
		if temp == rocks[i]:
			result += 1
		else:
			temp = rocks[i]
	print(result)


n = int(input())
a = input()
t = 0
for i in range(n):
	if i != 0 and a[i] == a[i - 1]:
		t = t + 1
print(t)


x = int(input())
y = input()
count = 0
i = 0
while i < len(y) - 1:
	if y[i] == y[i + 1]:
		count = count + 1
	i = i + 1
print(count)


def stones(n, ar):
	count = 0
	for i in range(n):
		if i + 1 < n and ar[i] == ar[i + 1]:
			count += 1
	print(count)
n = int(input())
ar = input()
stones(n, ar)


n = int(input())
stone = input()
length = len(stone) - 1
stone = list(stone)
i = 0
count = 0
while length != 0:
	if stone[i] == stone[i + 1]:
		count += 1
		stone.pop(i)
	else:
		i += 1
	length -= 1
print(count)


n = int(input())
s = input()
my_list = []
count = 0
for i in s:
	my_list.append(i)
for v in range(0, n - 1):
	if my_list[v] == my_list[v + 1]:
		count += 1
print(count)


t = int(input())
stones = input()
lastChar = stones[0]
i = 1
ans = 0
while i in range(len(stones)):
	if stones[i] == lastChar:
		ans += 1
	lastChar = stones[i]
	i += 1
print(ans)


input()
s = input()
k = 0
c = ''
for t in s:
	if t == c:
		k += 1
	else:
		c = t
print(k)


n = int(input())
stones = input()
remove = 0
for i in range(len(stones)):
	if i == len(stones) - 1:
		break
	if stones[i] == 'R':
		curr_stone = 'R'
	elif stones[i] == 'G':
		curr_stone = 'G'
	else:
		curr_stone = 'B'
	if curr_stone == stones[i + 1]:
		remove += 1
print(remove)


n = int(input())
a = list(input())
count = 0
k = 0
for i in range(1, n):
	if a[i] == a[k]:
		count += 1
	else:
		k = i
print(count)


n = int(input())
line = list(input())
counter = 0
flag = 0
for i in range(1, n):
	cur = line[i]
	prev = line[i - 1]
	if cur == prev:
		counter += 1
print(counter)


x = int(input())
y = input()
c = 0
m = y[0]
for i in y:
	if m == i:
		c += 1
	m = i
print(c - 1)


N = int(input())
L = input()
c = 0
for i in range(N):
	if i < N - 1:
		if L[i] == L[i + 1]:
			c += 1
print(c)


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


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()
previous = None
m = 0
for c in s:
	if c == previous:
		m += 1
	else:
		previous = c
print(m)


a = int(input())
b = list(input())
c = 0
for x in range(0, a - 1):
	if b[x] == b[x + 1]:
		c += 1
print(c)


n = int(input())
s = input()
c = 0
for i in range(n):
	if i == n - 1:
		break
	elif s[i] == s[i + 1]:
		s.replace(s[i + 1], '')
		c += 1
print(c)


n = int(input())
word = input()
num = 0
colour = word[0]
for i in range(1, n):
	if word[i] == colour:
		num += 1
	else:
		colour = word[i]
print(num)


n = input()
a = input()
x = len(a) - 2
y = 0
i = 0
while i <= x:
	if a[i] == a[i + 1]:
		y = y + 1
	i = i + 1
print(y)


t = int(input())
s = input()
remove = True
count = 0
while len(s) > 0 and remove:
	remove = False
	i = 0
	while i < len(s) - 1:
		a = s[i]
		b = s[i + 1]
		if a == b:
			s = s[:i] + s[i + 1:]
			count += 1
			remove = True
		i += 1
print(count)


k = 0
n = int(input())
a = list(input())
for i in range(n - 1):
	if a[i] == '2':
		break
	if a[i] == a[i + 1]:
		a[i] = '2'
while '2' in a:
	a.remove('2')
	k += 1
print(k)


from collections import defaultdict

def main():
	import re
	s = input()
	s = list(input())
	n = 0
	last = s.pop(0)
	while s:
		x = s.pop(0)
		if x == last:
			n += 1
		last = x
	print(n)
main()


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


import math
a = int(input())
b = input()
liste = list(b)
liste2 = []
for i in range(a - 1):
	if liste[i] == liste[i + 1]:
		liste2.append(1)
	else:
		pass
print(int(math.fsum(liste2)))


def solve():
	n = int(input())
	row = input()
	ans = 0
	i = 1
	while i < n:
		if row[i - 1] == row[i]:
			ans += 1
		i += 1
	print(ans)

def main():
	solve()
main()


n = int(input())
l = [str(x) for x in input().split()]
r = 0
for i in range(len(l[0]) - 1):
	if l[0][i] == l[0][i + 1]:
		r += 1
print(r)


try:
	n = int(input())
	s = input()
	t = len(s)
	cnt = 0
	for i in range(0, t - 1):
		if s[i] == s[i + 1]:
			cnt += 1
	print(cnt)
except:
	pass


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


input()
row = input()
print(sum([row[i] == row[i + 1] for i in range(len(row) - 1)]))


n = int(input())
word = input()
compare = word[0]
a = []
j = 0
for i in range(1, n):
	if compare == word[i]:
		j += 1
	else:
		compare = word[i]
		a.append(j)
		j = 0
if j != 0:
	a.append(j)
print(sum(a))


from sys import stdin
n = int(stdin.readline())
s = list(stdin.readline().rstrip())
res = 0
for i in range(n - 1):
	if s[i] == s[i + 1]:
		res += 1
print(res)


n = int(input())
str = input()
ans = 0
now = str[0]
for i in range(1, n):
	if str[i] != now:
		now = str[i]
	else:
		ans = ans + 1
print(ans)


n = int(input())
s = input()
l = [0 for i in range(n)]
o = 0
r = 0

def odin(k):
	j = 0
	d = False
	while not d and j < len(k) - 1:
		d = k[j] == k[j + 1]
		j += 1
	return (d, j)
for i in range(n):
	l[i] = s[i]
while odin(l)[0]:
	del l[odin(l)[1]]
	o += 1
print(o)


t = int(input())
n = list(input())
s = [n[0]]
for i in range(1, len(n)):
	if n[i] == s[len(s) - 1]:
		continue
	else:
		s.append(n[i])
print(abs(len(n) - len(s)))


try:
	x = int(input())
	s = input()
	cnt = 0
	for i in range(1, x):
		if s[i] == s[i - 1]:
			cnt += 1
	print(cnt)
except:
	pass


n = int(input())
s = list(input())
c = 0
for i in range(n):
	try:
		if s[i] == s[i + 1]:
			c += 1
	except:
		break
print(c)


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


n = int(input())
stones = list(input())
terminate = False
t = 0
while not terminate:
	for (i, j) in zip(range(n - 1), range(1, n)):
		if stones[i] == stones[j]:
			t += 1
		else:
			continue
	else:
		terminate = True
print(t)


def main(str):
	count = 0
	for i in range(1, len(str)):
		if str[i - 1] == str[i]:
			count += 1
	return count
num = int(input())
ans = main(input())
print(ans)


t = int(input())
ip = input()
(s, e) = (0, 1)
count = 0
for i in range(t - 1):
	if ip[s] == ip[e]:
		count += 1
		s += 1
		e += 1
	else:
		s += 1
		e += 1
print(count)


_ = int(input())
colours = input()
min_stones_to_remove = 0
previous_colour = colours[0]
for colour in colours[1:]:
	if colour == previous_colour:
		min_stones_to_remove += 1
	previous_colour = colour
print(min_stones_to_remove)


c = 0
rst = 0
n = int(input())
row = list(input())
for i in range(1, n):
	if row[i] == row[i - 1 - rst]:
		c += 1
		rst += 1
	else:
		rst = 0
print(c)


n = int(input())
st = input()[:n]
sc = 0
for i in range(len(st) - 1):
	if st[i] == st[i + 1]:
		sc += 1
print(sc, end='')


a = int(input())
k = 0
l = 0
b = input()
b = list(b)
if 1:
	if len(b) == 1:
		print(0)
		l = 1
	if len(b) > 1:
		for i in range(len(b)):
			if i == 0:
				if b[i] == b[i + 1]:
					k += 1
					b[i] = ''
			if i == len(b) - 1:
				if b[i] == b[i - 1]:
					k += 1
					b[i] = ''
			elif i != 0 and i != len(b) - 1:
				if b[i] != '' and (b[i] == b[i - 1] or b[i] == b[i + 1]):
					b[i] = ''
					k += 1
if l == 0:
	print(k)


n = int(input())
str1 = str(input())
isanswer = False
if n == 1:
	print(0)
	isanswer = True
answer = 0
for i in range(len(str1)):
	if i == 0:
		continue
	if str1[i] == str1[i - 1]:
		answer += 1
if isanswer == False:
	print(answer)


x = int(input())
y = input()
a = 0
for i in range(x - 1):
	if y[i] == y[i + 1]:
		a += 1
	else:
		pass
print(a)


a = input()
b = input()
lista = []
for i in b:
	lista.append(i)
licznik = 0
for i in range(int(a) - 1):
	if lista[i] == lista[i + 1]:
		licznik = licznik + 1
print(licznik)


a = b = 0
input()
for i in input():
	a += b == i
	b = i
print(a)


n = int(input())
s = input()
stack = [s[0]]
for c in range(1, len(s)):
	if stack[len(stack) - 1] != s[c]:
		stack.append(s[c])
print(n - len(stack))


re = int(input())
x = str(input())
val = 0
for k in range(re):
	try:
		if x[k] == x[k + 1]:
			val += 1
	except IndexError:
		pass
print(val)


def color(n):
	string = input()
	s = list(string)
	i = 0
	j = 1
	while j < len(s):
		if s[i] == s[j]:
			s.remove(s[j])
		else:
			i += 1
			j += 1
	return len(string) - len(s)
n = int(input())
print(color(n))


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


n = int(input())
s = list(input())
cache = s[0]
for i in range(1, n):
	if s[i] == cache:
		cache = s[i]
		s[i] = 1
	else:
		cache = s[i]
print(s.count(1))


a = int(input())
b = input()
arr = []
for i in range(a):
	arr.append(b[i])
j = 1
c = 0
while j < a:
	if arr[j] == arr[j - 1]:
		arr.pop(j)
		c += 1
		a -= 1
	else:
		j += 1
print(c)


n = int(input())
s = input()
removes = 0
for i in range(n):
	st = s[i:i + 2]
	if st == 'RR' or st == 'GG' or st == 'BB':
		removes += 1
print(removes)


N = int(input())
s = input()
sum = 0
for j in range(len(s) - 1):
	if s[j] == s[j + 1]:
		sum = sum + 1
print(sum)


_ = input()
s = input()
i = 1
to_remove = 0
current = s[0]
acc = s[0]
while i < len(s):
	if s[i] == current:
		acc += s[i]
		to_remove += 1
	else:
		current = s[i]
	i += 1
print(to_remove)


n = int(input())
string = input()
i = 1
count = 0
char = string[0]
lngth = len(string)
while i <= lngth - 1:
	if string[i] == char:
		count = count + 1
		i = i + 1
	else:
		char = string[i]
		i = i + 1
print(count)


nh = int(input())
sh = input()
ch = 0
if nh != 1:
	for i in range(1, nh):
		if sh[i] == sh[i - 1]:
			ch = ch + 1
print(ch)


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


length = int(input())
string = list(input())
cnt = 1
try:
	while cnt <= len(string) - 1:
		if string[cnt] == string[cnt - 1] or string[cnt] == string[cnt + 1]:
			string.pop(cnt)
			cnt = 0
		cnt += 1
except IndexError:
	if len(string) == 2:
		if string[0] == string[1]:
			string.pop()
print(length - len(string))


x = int(input())
arr = input()
c = 0
for n in range(x - 1):
	if arr[n] == arr[n + 1]:
		c = c + 1
print(c)


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


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


cnt = input()
string = input()
i = 0
for (index, letter) in enumerate(string):
	if index + 1 < len(string):
		if letter == string[index + 1]:
			i += 1
print(i)


nStones = int(input())
stones = [letter for letter in input()]
stones.append('a')
count = 0
for i in range(nStones):
	if stones[i] == stones[i + 1]:
		count += 1
print(count)


def stones(s):
	prev = ''
	take = 0
	for i in range(len(s)):
		if s[i] == prev:
			take += 1
		else:
			prev = s[i]
	return take
n = int(input().strip())
s = input().strip()
print(stones(s))


input()
string = input()
l = list(string)
c = 0
i = 0
while i < len(l) - 1:
	if l[i] == l[i + 1]:
		l.pop(i + 1)
		c += 1
	else:
		i += 1
print(c)


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


def remove_stones(n_stones):
	stone_str = input()
	if n_stones == 1:
		print(0)
		return 0
	else:
		pos_index = 1
		num_stones_removed = 0
		while pos_index < n_stones:
			if stone_str[pos_index - 1] == stone_str[pos_index]:
				num_stones_removed += 1
			pos_index += 1
	print(num_stones_removed)
num_stones = int(input())
remove_stones(num_stones)


try:
	n = int(input())
	s = input()
	prev = s[0]
	count = 0
	for i in range(1, len(s)):
		if prev == s[i]:
			count += 1
		else:
			prev = s[i]
	print(count)
except:
	pass


n = int(input())
s = input()
if s.count('r') == n or s.count('b') == n or s.count('g') == n:
	print(n - 1)
else:
	i = 0
	c = 0
	for i in range(len(s) - 1):
		if s[i] == s[i + 1]:
			c += 1
			i += 1
	print(c)


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


length = int(input())
string = input()
to_replace = 0
for i in range(length - 1):
	if string[i] == string[i + 1]:
		to_replace += 1
print(to_replace)


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)


def split(word):
	return [char for char in word]
n = int(input())
lst = split(input())
x = 0
tmp = ''
for i in range(0, n):
	if tmp == lst[i]:
		x += 1
		tmp = lst[i]
	else:
		tmp = lst[i]
		continue
print(x)


n = int(input())
s = input() + ' '
m = 0
(now, cnt) = (' ', 0)
for a in s:
	if now != a:
		m += min(cnt, 1)
		(cnt, now) = (1, a)
	else:
		cnt += 1
print(n - m)


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


import sys
import math
from collections import Counter
from collections import OrderedDict
from functools import reduce
sys.setrecursionlimit(10 ** 6)

def inputt():
	return sys.stdin.readline().strip()

def printt(n):
	sys.stdout.write(str(n) + '\n')

def listt():
	return [int(i) for i in inputt().split()]

def gcd(a, b):
	return math.gcd(a, b)

def lcm(a, b):
	return a * b // gcd(a, b)

def factors(n):
	return set(reduce(list.__add__, ([i, n // i] for i in range(1, int(n ** 0.5) + 1) if n % i == 0)))

def comb(n, k):
	factn = math.factorial(n)
	factk = math.factorial(k)
	fact = math.factorial(n - k)
	ans = factn // (factk * fact)
	return ans
n = int(inputt())
s = inputt()
d = Counter(s)
if len(d) < 2:
	printt(int(*d.values()) - 1)
else:
	count = 0
	for i in range(1, n):
		if s[i] == s[i - 1]:
			count += 1
	print(count)


a = int(input())
i = input()
c = 0
for j in range(0, len(i) - 1):
	if i[j] == i[j + 1]:
		c = c + 1
print(c)


numberOfStones = input()
colorsOfStones = input()

def removeNextSameStone(stone2, colorsOfStones):
	colorsOfStones = list(colorsOfStones)
	colorsOfStones[stone2] = ''
	colorsOfStones = ''.join(colorsOfStones)
	return colorsOfStones

def checkRemove(colorsOfStones):
	for i in range(int(len(colorsOfStones)) - 1, -1, -1):
		if i > 0:
			if colorsOfStones[i] == colorsOfStones[i - 1]:
				colorsOfStones = removeNextSameStone(i, colorsOfStones)
		else:
			return colorsOfStones
newNumber = int(len(checkRemove(colorsOfStones)))
print(int(numberOfStones) - int(newNumber))


n = int(input())
array = str(input())
list1 = list()
x = 1
while x in range(1, n):
	if array[x] == array[x - 1]:
		x = x + 1
	else:
		list1.append(array[x])
		x = x + 1
final = array[0] + ''.join(list1)
d = len(final)
print(n - d)


class StonesOnTheTable:

	def solve(self, n, stones):
		changes = 0
		for i in range(1, n):
			if stones[i] == stones[i - 1]:
				changes += 1
		return changes
n = int(input())
stones = input()
s = StonesOnTheTable()
print(s.solve(n, stones))


from sys import stdin, stdout
n = int(stdin.readline().strip())
s_list = list(stdin.readline().strip())
count = 0
for i in range(n - 1):
	if s_list[i] == s_list[i + 1]:
		count += 1
	else:
		pass
stdout.write(str(count))


from math import sqrt

def update(d):
	return d.replace('RR', 'R').replace('GG', 'G').replace('BB', 'B')

def main():
	s = input()
	d = input()
	ds = len(d)
	while d != update(d):
		d = update(d)
	print(ds - len(d))
main()


n = int(input())
stones = input()
p = stones[0]
c = 0
for s in stones[1:]:
	if p == s:
		c += 1
	else:
		p = s
print(c)


import math
n = input()
s = input()
p = s[0]
r = 0
for i in range(1, len(s)):
	if s[i] == p:
		r += 1
	else:
		p = s[i]
print(r)


nElem = int(input())
stones = str(input())
cambios = 0
actual = ''
pActual = 0
while True:
	if len(stones) == 1:
		break
	if pActual == 0:
		if pActual + 1 < nElem:
			if stones[pActual] == stones[pActual + 1]:
				stones = stones[:pActual] + stones[pActual + 1:]
				cambios += 1
			else:
				pActual += 1
	elif stones[pActual - 1] == stones[pActual]:
		stones = stones[:pActual] + stones[pActual + 1:]
		cambios += 1
	elif pActual + 1 < nElem:
		if stones[pActual] == stones[pActual + 1]:
			stones = stones[:pActual] + stones[pActual + 1:]
			cambios += 1
		else:
			pActual += 1
	if pActual == len(stones) - 1:
		break
	elif len(stones) <= 1:
		cambios = nElem
		break
print(cambios)


n = int(input())
color = input()
consecutive = 0
ar = []
for i in range(0, n - 1):
	if color[i] == color[i + 1]:
		consecutive += 1
	else:
		ar.append(consecutive)
		consecutive = 0
ar.append(consecutive)
print(sum(ar))


noOfChar = int(input())
arrangedOrder = input()
isDelete = 0
for i in range(0, noOfChar):
	if i < noOfChar - 1:
		if arrangedOrder[i] == arrangedOrder[i + 1]:
			isDelete = isDelete + 1
print(isDelete)


n = int(input())
run = 0
mang = list(input())
for i in range(n - 1):
	if mang[i] == mang[i + 1]:
		run = run + 1
print(run)


b = input()
a = input()
count = 0
st = []
for i in range(1, len(a)):
	if a[i] == a[i - 1]:
		count += 1
print(count)


count = 0
remove = 0
N = int(input())
count_r = 0
count_g = 0
count_b = 0
n = 0
stones = list(map(str, list(input())))
if N == len(stones):
	for i in stones:
		if i == 'R':
			count_b = 0
			count_g = 0
			count_r += 1
			if count_r >= 2:
				n += 1
		elif i == 'B':
			count_r = 0
			count_g = 0
			count_b += 1
			if count_b >= 2:
				n += 1
		elif i == 'G':
			count_b = 0
			count_r = 0
			count_g += 1
			if count_g >= 2:
				n += 1
print(n)


def main():
	n = int(input())
	pattern = input()
	previousStone = pattern[0]
	count = 0
	for i in pattern[1:]:
		nextStone = i
		if previousStone == nextStone:
			count += 1
		previousStone = nextStone
	print(count)
main()


input()
(s, a) = (input(), 0)
for x in ['RGB']:
	b = 0
	for i in range(~-len(s)):
		if s[i] == s[-~i]:
			b += 1
			a = max(a, b)
print(a)


N = int(input())
stroke = input()
while 'RR' in stroke or 'BB' in stroke or 'GG' in stroke:
	stroke = stroke.replace('RR', 'R').replace('BB', 'B').replace('GG', 'G')
print(N - len(stroke))


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


l = input()
s = input()
print(sum([p == c for (p, c) in zip(s[1:], s)]))


s = input()
s = input()
s = s + ','
cnt = 0
ans = 0
c = s[0]
for i in s:
	if c == i:
		cnt = cnt + 1
	else:
		ans = ans + cnt - 1
		cnt = 1
		c = i
print(ans)


input()
s = input()
res = sum((s[i] == s[i + 1] for i in range(len(s) - 1)))
print(res)


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


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


n = int(input())
colorsList = list(input())
first = 0
second = 1
counter = 0
while second < len(colorsList) and len(colorsList) > 0:
	if colorsList[first] == colorsList[second]:
		colorsList.remove(colorsList[first])
		counter += 1
	if len(colorsList) > second:
		if colorsList[first] != colorsList[second]:
			first += 1
			second += 1
print(counter)


N = int(input())
stones = list(input())
res = 0
i = 0
while i < N - 1:
	if stones[i] == stones[i + 1]:
		stones.pop(i + 1)
		res += 1
		N -= 1
		i -= 1
	i += 1
print(res)


n = int(input())
colors = input()
i = 0
next_c = i + 1
stones = 0
while i < len(colors) - 1:
	if colors[i] == colors[next_c]:
		stones += 1
		i += 1
		next_c += 1
	else:
		i += 1
		next_c += 1
print(stones)


n = input()
stones = input()
n_of_removed = 0
for (i, stone) in enumerate(list(stones)):
	if i != 0 and stone == stones[i - 1]:
		n_of_removed += 1
print(n_of_removed)


(n, rocks) = (int(input()), input())
print(sum([rocks[i] == rocks[i + 1] for i in range(n - 1)]))


moveCount = 0
currentStone = ''
n = input()
if n.isdigit() & (1 <= n.__len__() <= 50):
	inputString = input()
	if inputString.isalpha() & inputString.__len__().__eq__(int(n)):
		for index in range(int(n) - 1):
			currentStone = inputString[index]
			tmp = inputString[index + 1]
			if currentStone.__eq__(tmp):
				moveCount += 1
		print(moveCount)


n = int(input())
list1 = list(input())
(count, q) = (0, list1[0])
for i in range(1, len(list1)):
	if q == list1[i]:
		count += 1
	else:
		q = list1[i]
print(count)


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


a = input()
a = 0
cores = input()
for i in range(len(cores) - 1):
	if cores[i] == cores[i + 1]:
		a = a + 1
print(a)


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


import re
input()
string = input()
result = re.sub('([RGB])\\1+', '\\g<1>', string)
print(len(string) - len(result))


n = int(input())
stones = input()
num_removed = 0

def check(stones):
	global num_removed
	for i in range(len(stones) - 1):
		if stones[i] == stones[i + 1]:
			num_removed += 1
			check(stones[:i] + stones[i + 1:])
			break
check(stones)
print(num_removed)


n = int(input())
w = input()
f = 0
for i in range(n - 1):
	if i < len(w) and w[i] == w[i + 1]:
		f += 1
print(f)


n = int(input())
s = input().rstrip()
c = 0
for i in range(len(s) - 1):
	if s[i] == 'R' and s[i + 1] == 'R':
		c += 1
	elif s[i] == 'G' and s[i + 1] == 'G':
		c += 1
	elif s[i] == 'B' and s[i + 1] == 'B':
		c += 1
print(c)


q = 0
w = []
while 1 >= q:
	w.append(input())
	q = q + 1
i = 0
j = 0
while int(w[0]) - 2 >= i:
	if w[1][i] == w[1][i + 1]:
		j = j + 1
	else:
		pass
	i = i + 1
print(j)


n = int(input())
sts = list(input())
sts2 = sts.copy()
count = 0
i = 0
while i < len(sts) - 1:
	if sts[i] == sts[i + 1]:
		c = sts[i]
		i = i + 1
		while i < len(sts) and sts[i] == c:
			i = i + 1
			count = count + 1
	else:
		i = i + 1
print(count)


input()
n = list(input())
minimum = 999999999999999999999999999999999999999999999
s = 0
for i in range(len(n) - 1):
	if n[i] == n[i + 1]:
		s += 1
	i += 1
print(s)


NumOfIteration = input()
Stones = input()
i = 0
count = 0
for i in range(Stones.__len__() - 1):
	if Stones[i] == Stones[i + 1]:
		count += 1
	else:
		continue
print(count)


n = int(input())
arr = input()
v = []
moves = 0
for item in arr:
	v.append(ord(item))
for i in range(n - 1):
	if int(v[i]) == int(v[i + 1]):
		moves += 1
	else:
		pass
print(moves)


n = int(input())
tab = []
s = input()
counter = 0
for i in range(0, n):
	tab.append(s[i])
tab.count('R')
tab.count('B')
tab.count('G')
for i in range(0, n - 1):
	if tab[i] == tab[i + 1]:
		counter += 1
print(counter)


n = int(input())
string = input()
total = 0
for i in range(len(string)):
	if i > 0 and string[i] == string[i - 1]:
		total += 1
print(total)


n = int(input())
s = input()
last = ''
r = 0
for c in s:
	if c == last:
		r += 1
	last = c
print(r)


ilosc_kamieni = int(input())
kolory = input()
z = 0
for i in range(ilosc_kamieni - 1):
	if kolory[i] == kolory[i + 1]:
		z += 1
print(z)


num = int(input())
stones: str = input()
count = 0
for i in range(1, num):
	if stones[i - 1] == stones[i]:
		count += 1
print(count)


n = int(input())
stones = input().strip()
l = len(stones)
(curr, prev, ans) = ('\x00', '\x00', 0)
for i in range(l):
	curr = stones[i]
	if curr == prev:
		ans += 1
	else:
		prev = curr
print(ans)


n = int(input())
k = input()
w = 1
p = 0
while w < n:
	if k[w] == k[w - 1]:
		p += 1
	w += 1
print(p)


n_stone = input()
color_stone = input()
stone = list(color_stone)
n_stone = int(n_stone)
ans = 0
for i in range(n_stone - 1):
	if stone[i] == stone[i + 1]:
		ans += 1
print(ans)


l = int(input())
str1 = input()
cnt = 0
for i in range(len(str1)):
	if i != len(str1) - 1 and str1[i] == str1[i + 1]:
		cnt += 1
print(cnt)


n = int(input())
s = str(input())
cnt = 0
last = ''
for i in s:
	if i == last:
		cnt = cnt + 1
	last = i
print(cnt)


i = int(input())
s = list(str(input()))
c = 0
j = 0
z = s[0]
for i in range(1, len(s)):
	if z == s[i]:
		c += 1
	z = s[i]
print(c)


a = int(input())
inputStr = input()
l = list(inputStr)
count = 0
for i in range(a - 1):
	if l[i] == l[i + 1]:
		count = count + 1
print(count)


(_, s) = (input(), input())
count = 0
for (i, x) in enumerate(s):
	if i < len(s) - 1:
		if x == s[i + 1]:
			count += 1
print(count)


(i, arr) = (int(input()), list(input()))
count = 0
for each in range(i):
	if each != i - 1:
		if arr[each] == arr[each + 1]:
			count += 1
print(count)


quantity = int(input(''))
place = str(input(''))
l = list(place)
ans = 0
for i in range(0, quantity - 1):
	if l[i] == l[i + 1]:
		ans = ans + 1
print(ans)


n = input()
text = input()
leng = len(text)
count = 0
i = 0
while i < leng - 1:
	st = text[i]
	if st == text[i + 1]:
		count = count + 1
		i = i + 1
	else:
		i = i + 1
print(count)


def do(a, n):
	count = 0
	for i in range(1, n):
		if a[i - 1] == a[i]:
			count += 1
	return count
n = int(input())
a = input()
print(do(a, n))


n = int(input())
l = list(input())
i = c = 0
while i < n - 1:
	if l[i] == l[i + 1]:
		c += 1
	i += 1
print(c)


x = int(input())
string = input()
array = []
c = 0
count = 0
while c < x:
	array.append(string[c])
	c += 1
c = 1
while c < x:
	if array[c] == array[c - 1]:
		count += 1
	c += 1
print(count)


class Code:

	def __init__(self):
		self.n = int(input())
		self.s = input()

	def process(self):
		cnt = 0
		for i in range(1, self.n):
			if self.s[i] == self.s[i - 1]:
				cnt += 1
		print(cnt)
code = Code()
code.process()


x = int(input())
s = str(input())
z = 0
for i in range(len(s) - 1):
	if s[i] == s[i + 1]:
		s[i].replace(s[i], '')
		z += 1
print(z)


n = int(input())
s = input()
stack = [s[0]]
count = 0
for c in s[1:]:
	if stack[-1] == c:
		count += 1
	else:
		stack.append(c)
print(count)


def stonesDel(s):
	st = 0
	for i in range(0, len(s) - 1):
		if s[i] == s[i + 1]:
			st += 1
	return st
n = input()
s = input()
print(stonesDel(s))


n = int(input())
A = list(input())
B = []
for i in range(len(A) - 1):
	if A[i] == A[i + 1]:
		B.append(1)
print(len(B))


n = int(input())
s = list(map(str, input().upper()))[:n]
flag = 0
for i in range(n - 1):
	if s[i] == s[i + 1]:
		flag += 1
print(flag)


a = int(input())
b = list(map(str, input().strip()))
j = 0
for i in range(a - 1):
	if b[i] == b[i + 1]:
		j = j + 1
print(j)


stones_count = input()
remove = 0
stones = input()
for i in range(0, len(stones) - 1):
	if stones[i] == stones[i + 1]:
		remove += 1
print(remove)


count = int(input())
stones = list(input())
l = len(stones)
while True:
	for i in range(len(stones) - 1):
		if stones[i] == stones[i + 1]:
			del stones[i]
			break
	else:
		break
print(l - len(stones))


m = int(input())
count = 0
str1 = input()
w = list(str1)
for i in range(0, len(str1) - 1):
	if w[i] == w[i + 1]:
		count += 1
print(count)


n = int(input())
s = input()
d = 0
for i in range(n - 1):
	a = s[i:i + 2]
	if a == 'RR':
		d += 1
	elif a == 'GG':
		d += 1
	elif a == 'BB':
		d += 1
	else:
		pass
print(d)


a = input()
a = int(a)
str_ = input()
count = 0
temp = 0
for i in range(a - 1):
	temp = str_[0]
	if str_[i] == str_[i + 1]:
		count += 1
print(count)


def solve(n):
	c = 0
	for i in range(1, len(n)):
		if n[i] == n[i - 1]:
			c += 1
	return c
n1 = input()
n = input()
print(solve(n))


n = int(input())
a = input()
ans = 0
while a.find('RR') != -1:
	ans += 1
	a = a[:a.find('RR')] + a[a.find('RR') + 1:]
while a.find('GG') != -1:
	ans += 1
	a = a[:a.find('GG')] + a[a.find('GG') + 1:]
while a.find('BB') != -1:
	ans += 1
	a = a[:a.find('BB')] + a[a.find('BB') + 1:]
print(ans)


tamanho = int(input())
lista = list(input())
contagem = 0
j = 1
while j < tamanho:
	if lista[j] == lista[j - 1]:
		contagem += 1
	j += 1
print(contagem)


input()
string = input()
pre = None
counter = 0
for i in string:
	if pre:
		if i == pre:
			counter += 1
	pre = i
print(counter)


l = int(input())
s = input()

def solve(s):
	count = 0
	for i in range(0, len(s) - 1):
		if s[i] != s[i + 1]:
			continue
		else:
			count += 1
	print(count)
solve(s)


n = input()
str = input()
res = 0
for (i, j) in zip(str, str[1:]):
	if i == j:
		res += 1
print(res)


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


import re
input()
print(sum((len(s) - 1 for s in re.findall('R+|G+|B+', input()))))


from sys import stdin
numb = stdin.read()
number = numb.split()
string = ''
y = 0
c = 0
first_number = int(number[0])
for x in number[1:]:
	string += x
while first_number - 1 > y:
	if string[y] == string[y + 1]:
		c += 1
		y += 1
	elif string[y] != string[y + 1]:
		y += 1
print(c)


t = input()
s = input()
p = s[0]
c = 0
for i in s[1:]:
	if i != p:
		p = i
	else:
		c += 1
print(c)


x = int(input())
str = input()
tot = 0
for i in range(x - 1):
	if str[i] == str[i + 1]:
		tot += 1
print(tot)


size = int(input())
s = input()
l = []
for i in s:
	l.append(i)
count = 0
for i in range(size):
	if i == size - 1:
		break
	if l[i] == l[i + 1]:
		count += 1
print(count)


n = int(input())
p = list(input())
a = []
for i in range(0, len(p) - 1):
	if p[i] == p[i + 1]:
		a.append(p[i])
t = len(a)
print(int(t))


Ile = int(input())
TablicaZKlawiatury = input()
Licznik = 0
for i in range(0, Ile - 1):
	if TablicaZKlawiatury[i] != TablicaZKlawiatury[i + 1]:
		Licznik += 1
Licznik += 1
print(Ile - Licznik)


c = 0
n = input()
one = list(input())
for i in range(len(one) - 1):
	if one[i] == one[i + 1]:
		c += 1
	else:
		continue
print(c)


a = input()
n = input()
cnt = 0
for (val, i) in enumerate(n):
	try:
		if i == n[val + 1]:
			cnt += 1
	except:
		pass
print(cnt)


n = int(input())
s = input()
p = s
l = []
for i in range(0, len(s) - 1):
	if s[i + 1] == s[i]:
		l.append(int(i))
print(len(l))


n = int(input())
stones = input()
stones = list(stones)
temp = [0]
for i in stones:
	if i != temp[-1]:
		temp.append(i)
temp.pop(0)
print(n - len(temp))


n = int(input())
s = input()
s2 = [0]
for i in range(n):
	if s[i] != s2[-1]:
		s2.append(s[i])
r = n - (len(s2) - 1)
print(r)


t = int(input())
n = input()
c = 0
i = len(n)
v = 0
while v < i - 1:
	if n[v] == n[v + 1]:
		c = c + 1
	v = v + 1
print(c)


input()
line = input()
ans = 0
prev = 'X'
for c in line:
	if c == prev:
		ans += 1
	else:
		prev = c
print(ans)


num = input()
s = input()
t = 0
for i in range(1, len(s)):
	if s[i] == s[i - 1]:
		t = t + 1
print(t)


N = input()
str1 = input()
a = int(str1.find('RR'))
n = 0
while a >= 0:
	str1 = '.'.join(str1)
	list1 = str1.split('.')
	list1.pop(a)
	str1 = ''.join(list1)
	a = int(str1.find('RR'))
	n = n + 1
b = int(str1.find('GG'))
while b >= 0:
	str1 = '.'.join(str1)
	list2 = str1.split('.')
	list2.pop(b)
	str1 = ''.join(list2)
	b = int(str1.find('GG'))
	n = n + 1
c = int(str1.find('BB'))
while c >= 0:
	str1 = '.'.join(str1)
	list3 = str1.split('.')
	list3.pop(c)
	str1 = ''.join(list3)
	c = int(str1.find('BB'))
	n = n + 1
print(n)


n = int(input())
s = input()
count = 0
x = ''
for color in s:
	if color == x:
		count += 1
	x = color
print(count)


n = int(input())
match = ''
cont = 0
for i in input():
	if match == '':
		match = i
	elif i == match:
		cont += 1
	else:
		match = i
print(cont)


n = input()
s = input()
a = 0
b = s[0]
for i in s[1:]:
	a += 1 if b == i else 0
	b = i
print(str(a))


import math
import os
import random
import re
import sys

class StonesontheTable:

	def solve(self, n, stones):
		changes = 0
		for i in range(1, n):
			if stones[i] == stones[i - 1]:
				changes += 1
		return changes
n = int(input())
stones = input()
s = StonesontheTable()
print(s.solve(n, stones))


taken = 0
row = int(input())
colors = list(input())
for i in range(row - 1):
	if colors[i] == colors[i + 1]:
		taken += 1
print(taken)


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


value = int(input())
stones = input()
changes = 0
for i in range(value - 1):
	if i < value - 1:
		if stones[i + 1] == stones[i]:
			changes += 1
print(changes)


n = int(input())
s = input()
letters = []
cdl = 0
for i in s:
	letters.append(i)
for i in range(len(letters) - 1):
	if letters[i] == letters[i + 1]:
		letters[i] = 0
		cdl += 1
print(cdl)


n = int(input())
s = input()
l = []
output = 0
for i in s:
	l.append(i)
for i in range(n):
	if len(l) == 1:
		break
	elif l[0] == l[1]:
		output += 1
		l.remove(l[0])
	else:
		l.remove(l[0])
print(output)


a = int(input())
s = input()
b = 0
g = 0
while True:
	try:
		if s[b] == s[b + 1]:
			g += 1
		b += 1
	except Exception:
		break
print(g)


from itertools import groupby
i = input
i()
print(sum((len(list(g)) - 1 for (_, g) in groupby(i()))))


n = int(input())
text = input()
count = 0
for i in range(len(text) - 1):
	if text[i] == text[i + 1]:
		count += 1
	else:
		pass
print(count)


n = input()
s = input()
op = [s[0]]
for i in range(1, len(s)):
	if s[i] != op[-1]:
		op.append(s[i])
print(len(s) - len(op))


n = int(input())
str1 = input()
first = str1[0]
sum = 1
for i in range(n):
	if str1[i] != first:
		first = str1[i]
		sum += 1
result = n - sum
print(result)


numero = input()
piedras = input()
sacar = 0
for i in range(1, int(numero)):
	if piedras[i - 1] == piedras[i]:
		sacar += 1
print(sacar)


import sys
sys.stdin.readline()
line = sys.stdin.readline()
lastChar = None
toRemove = 0
for c in line:
	if c == lastChar:
		toRemove += 1
	else:
		lastChar = c
print(toRemove)


n = input()
s = input()
counter = 0
colors = list(s)
for i in range(int(n)):
	if i < int(n) - 1:
		if colors[i] == colors[i + 1]:
			counter += 1
		else:
			pass
	else:
		pass
print(counter)


def solve(n, stones):
	count = 0
	for i in range(1, n):
		if stones[i] == stones[i - 1]:
			count += 1
	return count
n = int(input())
stones = input()
r = solve(n, stones)
print(r)


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


input()
s = input()
count = 0
for (index, value) in enumerate(list(s)):
	try:
		if value == s[index + 1]:
			count += 1
	except:
		break
print(count)


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


n = int(input())
a = list(input())
an = 0
i = 0
while i < n:
	cn = 0
	j = i
	while j < n:
		if a[j] == a[i]:
			cn += 1
		else:
			break
		j += 1
	an += cn - 1
	if cn == 0:
		cn += 1
	i += cn
print(an)


def stones_on_the_table(stones):
	count = 0
	for i in range(1, len(stones)):
		if stones[i] == stones[i - 1]:
			count += 1
	print(count)
n1 = int(input())
stones = input()
stones_on_the_table(stones)


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


import sys
input = sys.stdin.readline

def main():
	n = int(input())
	s = input().strip()
	bef = ''
	ans = 0
	for ss in s:
		if ss == bef:
			ans += 1
		bef = ss
	print(ans)
main()


s = int(input())
a = list(input())
sh = 0
for i in range(1, len(a)):
	if a[i] == a[i - 1]:
		sh += 1
print(sh)


def count(n, arr):
	count = 0
	for i in range(n - 1):
		if arr[i] == arr[i + 1]:
			count += 1
	return count
n = int(input())
stones = input()
print(count(n, stones))


c = 0
t = int(input())
s = input()
for i in range(t - 1):
	if s[i] == 'R' and s[i + 1] == 'R':
		c = c + 1
	elif s[i] == 'G' and s[i + 1] == 'G':
		c = c + 1
	elif s[i] == 'B' and s[i + 1] == 'B':
		c = c + 1
print(c)


count = 0
n = int(input())
s = input()
if n == len(s):
	for i in range(0, len(s) - 1):
		if s[i] == s[i + 1]:
			count = count + 1
	print(count)
else:
	print('enter correctly')


n = int(input())
lst = []
a = input()
x = 0
y = 0
for i in range(0, n):
	lst.append(a[i])
while x < n - 1:
	if lst[x] == lst[x + 1]:
		lst.pop(x + 1)
		n -= 1
		y += 1
	else:
		x += 1
print(y)


n = input('')
stones = input('')
stones = list(stones)
out = 0
for i in range(len(stones) - 1):
	if stones[i] == stones[i + 1]:
		out += 1
print(out)


n = int(input())
s = input()
previous = None
count = 0
for stone in s:
	if previous:
		if stone == previous:
			count += 1
		else:
			previous = stone
	else:
		previous = stone
print(count)


lyst = []
stone_number = int(input())
stone_order = str(input())
counter = 0
for i in stone_order:
	lyst.append(i)
for j in range(stone_number - 1):
	if lyst[j] == lyst[j + 1]:
		counter += 1
print(counter)


from math import *
sInt = lambda : int(input())
mInt = lambda : map(int, input().split())
lInt = lambda : list(map(int, input().split()))
n = sInt()
s = input()
ans = 0
for i in range(1, n):
	if s[i] == s[i - 1]:
		i += 1
		ans += 1
print(ans)


skok = int(input())
arr = list(input())
chet = 0

def recurse(arr, chet):
	for i in range(0, len(arr)):
		if i != len(arr) - 1:
			if arr[i] == arr[i + 1]:
				del arr[i + 1]
				chet += 1
				return recurse(arr, chet)
		else:
			return chet
print(recurse(arr, chet))


n = input()
s = input()
m = sum((s[i] == s[i - 1] for i in range(1, len(s))))
print(m)


m = int(input())
l = input()
counter = 0
for i in range(0, len(l) - 1):
	if l[i] == l[i + 1]:
		counter += 1
print(counter)


num = input()
stones = input()
conter = int(0)
for i in range(len(stones) - 1):
	if stones[i] == stones[i + 1]:
		conter += 1
print(conter)


_ = input()
r = list(input())
count = 0
for i in range(len(r) - 1, 0, -1):
	if r[i] == r[i - 1]:
		r.pop(i)
		count += 1
print(count)


n = int(input())
inp = input()
initialColor = inp[0]
ans = 0
length = len(inp)
for i in range(1, length):
	if inp[i] == initialColor:
		ans += 1
	else:
		initialColor = inp[i]
print(ans)


t = int(input())
i = 0
p = 0
total = []
a = input()
while i < t:
	b = a[i]
	i = i + 1
	total.append(b)
j = 0
while j < len(total) - 1:
	if total[j + 1] == total[j]:
		del total[j]
		p = p + 1
	else:
		j = j + 1
print(p)


n = input()
s = input()
p = s[0]
res = 0
for i in range(1, len(s)):
	c = s[i]
	if p == c:
		res += 1
	else:
		p = c
print(res)


n = int(input())
s = input()
res = 0
pos = 0
while pos < n:
	pos1 = pos
	while pos1 + 1 < n and s[pos1 + 1] == s[pos]:
		pos1 += 1
	res += pos1 - pos
	pos = pos1 + 1
print(res)


n = int(input())
str = list(input())
ans = 0
cnt = 0
flag = False
for i in range(0, len(str) - 1):
	if str[i] == str[i + 1]:
		cnt = cnt + 1
print(cnt)


n = int(input())
l = list(map(str, input()))
x = 0
for j in range(n - 1):
	if l[j] == l[j + 1]:
		x += 1
print(x)


n = int(input())
col = input()
colors = ['R', 'B', 'G']
count = 0
for i in colors:
	r = col.split(i)
	count += r.count('')
	if r[-1] == '':
		count -= 1
	if r[0] == '':
		count -= 1
print(count)


T = int(input())
a = input()
c = 0
cur = ''
for i in range(T):
	if cur == a[i]:
		c += 1
	else:
		cur = a[i]
print(c)


num = int(input())
list_color = list(input())
list_color.append(None)
count = 0
j = 0
try:
	for i in range(num):
		i += j
		if list_color[i + 1] == list_color[i]:
			list_color.pop(i + 1)
			count += 1
			j -= 1
		elif list_color[i + 1] == list_color[i + 2]:
			list_color.pop(i + 1)
			count += 1
			j -= 1
except IndexError:
	pass
print(count)


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


n = int(input())
s = input()
prevC = ''
res = 0
for c in s:
	if c == prevC:
		res += 1
	else:
		prevC = c
print(res)


useless = input()
stones = input()
neig = 0
for i in range(len(stones)):
	try:
		if stones[i] == stones[i + 1]:
			neig += 1
	except IndexError:
		break
print(neig)


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


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


def StonesontheTable(n, stones):
	changes = 0
	for i in range(1, n):
		if stones[i] == stones[i - 1]:
			changes += 1
	return changes
n = int(input())
stones = input()
print(StonesontheTable(n, stones))


count = -1
n = int(input())
seq = input()
definite = seq[0]
for i in range(n):
	if seq[i] == definite:
		count += 1
	else:
		definite = seq[i]
if count >= 0:
	print(count)
else:
	print(0)


n = int(input())
m = input()
l = list(m)

def onc(l):
	s = 0
	if len(l) > 1:
		i = 0
		while i < len(l) - 1:
			if l[i] == l[i + 1]:
				l.remove(l[i])
				i -= 1
				s += 1
			i += 1
		return s
	else:
		return 0
print(onc(l))


def counting():
	t = int(input())
	word = list(input())
	counter = 0
	for i in range(t - 1):
		if word[i] == word[i + 1]:
			counter += 1
	print(counter)
counting()


number_of_rocks = int(input())
rocks = str(input())
number_of_deletion = 0
for i in range(number_of_rocks):
	if i == number_of_rocks - 1:
		break
	elif rocks[i] == rocks[i + 1]:
		number_of_deletion += 1
print(number_of_deletion)


n = int(input())
row = input()
take = 0
for i in range(n):
	if i > 0 and row[i - 1] == row[i]:
		take += 1
print(take)


count = 0
n = int(input())
sList = list(input())
for (i, j) in enumerate(range(1, len(sList))):
	if i != j and sList[i] == sList[j]:
		count += 1
print(count)


quality = int(input())
colors = input()
counter = 1
result = 0
for stone in colors:
	try:
		if stone == colors[counter]:
			result += 1
	except IndexError:
		break
	counter += 1
print(result)


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


k = int(input())
n = input()
start = n[0]
count = 0
i = 0
while i < len(n) - 1:
	if start == n[i + 1]:
		count += 1
		start = n[i + 1]
		i += 1
	else:
		start = n[i + 1]
		i += 1
print(count)


n = input()
tmp = input()
cnt = 0
for i in range(int(n)):
	if int(n) != i + 1:
		if tmp.__getitem__(i) == tmp.__getitem__(i + 1):
			cnt = cnt + 1
print(cnt)


x = int(input())
list = input()
count = 0
for i in range(len(list) - 1):
	if list[i] == 'R' and list[i + 1] == 'R':
		count += 1
	if list[i] == 'B' and list[i + 1] == 'B':
		count += 1
	if list[i] == 'G' and list[i + 1] == 'G':
		count += 1
print(count)


a = int(input())
s = input().upper()
mat = []
res = 0
for i in s:
	mat.append(i)
for i in range(len(mat) - 1):
	if mat[i] == mat[i + 1]:
		res += 1
print(res)


out_str = ''
count = 0
loop = int(input())
col_str = input()
i = None
for new_i in col_str:
	if i:
		if i == new_i:
			count += 1
	else:
		out_str = out_str + new_i
	i = new_i
print(count)


a = int(input())
list = []
line = input()
for i in line:
	list.append(i)
num = 0
for j in range(a - 1):
	if list[j] != list[j + 1]:
		num += 0
	else:
		num += 1
print(num)


n = input()
s = input()
result = 0
previous = ''
for c in s:
	if c == previous:
		result += 1
	else:
		previous = c
print(result)


def split(word):
	return [char for char in word]
t = int(input())
ls = input()
ls = split(ls)
s = [0]
s[0] = ls[0]
c = 0
for x in range(1, t):
	if ls[x] == s[-1]:
		c += 1
	else:
		s.append(ls[x])
print(c)


num = int(input())
word = input()
index = 0
count = 0
while index < len(word) - 1:
	if word[index] == word[index + 1]:
		count = count + 1
	index = index + 1
print(count)


def main():
	n = int(input())
	string = str(input())
	cnt = 0
	for i in range(len(string) - 1):
		if string[i] == string[i + 1]:
			cnt += 1
	print(cnt)
	return
main()


num_elements = int(input())
stones = input()
answer = 0
for i in range(len(stones[:-1])):
	if stones[i] == stones[i + 1]:
		answer += 1
print(answer)


n = int(input())
s = [i for i in input()]
res = 0
i = 1
while i < len(s):
	if s[i - 1] == s[i]:
		s.remove(s[i])
		res += 1
	else:
		i += 1
print(res)


p = input
p()
s = p()
print(sum((i == j for (i, j) in zip(s[1:], s))))


rocks = int(input())
data = input()
colors = []
step = 0
for i in range(0, rocks):
	colors.append(data[i])
for i in range(1, rocks):
	if colors[i - 1] == colors[i]:
		step += 1
print(step)


n = int(input())
s = str(input())
l = len(s)
sum = 0
while s.find('RR') != -1 or s.find('GG') != -1 or s.find('BB') != -1:
	for item in ('RR', 'GG', 'BB'):
		if s.find(item) != -1:
			l = s.find(item)
			s = s[:l] + item[:1] + s[l + 2:]
			sum = sum + 1
print(sum)


import sys
read = []
for line in sys.stdin:
	read.append(line)
stones = read[1][:-1]
last = stones[0]
groups = 1
for elem in stones:
	if elem != last:
		groups = groups + 1
	last = elem
print(str(int(read[0]) - groups))


n = int(input())
a = list(input())
ans = 0
if n == 1:
	print(0)
else:
	for i in range(n - 1):
		if a[i + 1] == a[i]:
			ans += 1
	print(ans)


n = int(input())
string = input()
string_L = list(string)
counter = 0
for i in range(n):
	if i == n - 1:
		break
	if string_L[i] == string_L[i + 1]:
		counter += 1
print(counter)


n = int(input())
s = str(input())
s = list(s)
c = 0
for i in range(0, len(s) - 1):
	if s[i] == s[i + 1]:
		c += 1
	else:
		continue
print(c)


def count_with_intersections(string, substring):
	c = 0
	index = string.find(substring)
	while index > -1:
		c += 1
		string = string[index + 1:]
		index = string.find(substring)
	return c
n = int(input())
s = input()
print(count_with_intersections(s, 'RR') + count_with_intersections(s, 'GG') + count_with_intersections(s, 'BB'))


n = int(input())
stones = input()
char = stones[0]
counter = 0
for c in stones[1:]:
	if c == char:
		counter += 1
	else:
		char = c
print(counter)


def num(a, b):
	count = 0
	for i in range(0, len(b) - 1, 1):
		if b[i] == b[i + 1]:
			count += 1
	print(count)
a = int(input(''))
b = input('')
if len(b) == a:
	num(a, b)


n = int(input())
s = input()
t = 0
for (a, b) in zip(s[1:], s):
	if a == b:
		t = t + 1
print(t)


d = int(input())
x = input()
f = 0
for i in range(len(x)):
	try:
		if x[i] == x[i + 1]:
			f += 1
	except:
		pass
print(f)


n = int(input())
s = input()
b = None
sum = 0
for i in s:
	if i == b:
		sum = sum + 1
	if b is None:
		b = i
	b = i
print(sum)


a = int(input())
y = list(input())
c = 0
for i in range(1, len(y)):
	if y[i - 1] == y[i]:
		c += 1
print(c)


(n, s) = (int(input()), input())
while s.find('RR') != -1 or s.find('GG') != -1 or s.find('BB') != -1:
	if s.find('RR') != -1:
		s = s.replace('RR', 'R')
	if s.find('GG') != -1:
		s = s.replace('GG', 'G')
	if s.find('BB') != -1:
		s = s.replace('BB', 'B')
print(n - len(s))


n = int(input())
stones = input()
prev = ''
moves = 0
for i in stones:
	if i == prev:
		moves += 1
	prev = i
print(moves)


def watermelon():
	w = int(input())
	if w % 2 == 0:
		print('YES')
	else:
		print('NO')

def way_too_long_words():
	n = int(input())
	words = [input() for x in range(n)]
	for word in words:
		if len(word) > 10:
			print(f'{word[0]}{len(word) - 2}{word[-1]}')
		else:
			print(word)

def team():
	n = int(input())
	v = [[int(x) for x in input().split()] for i in range(n)]
	o = 0
	for l in v:
		if l.count(1) >= 2:
			o += 1
	print(o)

def next_round():
	(n, k) = map(int, input().split())
	s = [int(x) for x in input().split()]
	o = 0
	i = s[k - 1]
	for j in s:
		if j >= i and j != 0:
			o += 1
	print(o)

def domino_piling():
	import math
	(m, n) = map(int, input().split())
	o = 0
	if m * n < 2:
		print(0)
		exit()
	if m % 2 == 0:
		o = m * n / 2
	elif n % 2 == 0:
		o = m * n / 2
	else:
		o = math.floor(m * n / 2)
	print(int(o))

def bitplusplus():
	n = int(input())
	s = [input() for i in range(n)]
	o = 0
	for j in s:
		if '++' in j:
			o += 1
		if '--' in j:
			o -= 1
	print(o)

def petya_and_strings():
	a = input().lower()
	b = input().lower()
	c = [a, b]
	c.sort()
	if a == b:
		print(0)
	elif b == c[0]:
		print(1)
	elif a == c[0]:
		print(-1)

def beautiful_matrix():
	for i in range(5):
		r = [int(x) for x in input().split()]
		if 1 in r:
			xmove = abs(r.index(1) - 2)
			ymove = abs(i - 2)
			o = xmove + ymove
	print(o)

def helpful_maths():
	s = input().split('+')
	s.sort()
	s = '+'.join(s)
	print(s)

def word_capitalization():
	a = input()
	a = a[0].upper() + a[1:]
	print(a)

def stones_on_the_table():
	n = int(input())
	a = input()
	o = 0
	for i in range(len(a) - 1):
		if a[i] == a[i + 1]:
			o += 1
	print(o)
stones_on_the_table()


n = int(input(''))
s = input('')
move = 0
for i in range(int(n * (n + 1) / 2)):
	if 'GG' in s:
		s = s.replace('GG', 'G', 1)
		move += 1
	if 'RR' in s:
		s = s.replace('RR', 'R', 1)
		move += 1
	if 'BB' in s:
		s = s.replace('BB', 'B', 1)
		move += 1
print(move)


input()
line = input()
removes = 0
current_block = 0
i = 0
while i < len(line):
	if line[i] != line[current_block]:
		removes += i - current_block - 1
		current_block = i
	i += 1
if current_block != i:
	removes += i - current_block - 1
print(removes)


n = int(input())
s = str(input())
count = 0
f = list(s)
for (x, y) in zip(f[0:], f[1:]):
	if x == y:
		count = count + 1
print(count)


def main():
	num = int(input())
	k = input()
	count = 0
	for i in range(num - 1):
		if k[i] == k[i + 1]:
			count += 1
	print(count)
main()


l = int(input())
s = input()
c = 0
while 'RR' in s or 'BB' in s or 'GG' in s:
	if 'RR' in s:
		s = s.replace('RR', 'R', 1)
		c += 1
	if 'BB' in s:
		s = s.replace('BB', 'B', 1)
		c += 1
	if 'GG' in s:
		s = s.replace('GG', 'G', 1)
		c += 1
print(c)


x = int(input())
y = input()
n = 0
z = 0
while n < x - 1:
	if y[n] == y[n + 1]:
		z += 1
		n += 1
	else:
		n += 1
print(z)


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


num = int(input())
s = input('')
p = 0
if num > 1:
	for i in range(len(s)):
		if i == 0:
			if s[0] == s[1]:
				p += 1
		elif i == len(s) - 1:
			pass
		elif s[i] == s[i + 1]:
			p += 1
	if p == len(s):
		p -= 1
else:
	pass
print(p)


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


initial_number = int(input())
initial_stones = str(input())
listed_stonesI = list(initial_stones)
prev_stone = ''
remaining_stone = []
for stone in listed_stonesI:
	if stone != prev_stone:
		remaining_stone.append(stone)
		prev_stone = stone
remaining_stone_number = len(''.join(remaining_stone))
stone_removed = initial_number - remaining_stone_number
print(stone_removed)


n = int(input())
rgb = input()
contador = 0
c = 0
i = 1
while i < len(rgb):
	if rgb[i] == rgb[c]:
		contador += 1
	else:
		c = i
	i = i + 1
print(contador)


def func():
	n = int(input())
	st = input()
	c = 0
	for i in range(1, len(st)):
		if st[i] == st[i - 1]:
			c = c + 1
	print(c)
func()


import string
n = int(input())
s = [str(z) for z in input().split()]
b = string.ascii_uppercase
z = []
c = 0
for i in s[0]:
	c = b.find(i)
	z.append(c)
	c = 0
for i in range(len(z) - 1):
	if z[i] == z[i + 1]:
		c += 1
	else:
		c += 0
print(c)


n = int(input())
string = input()

def remove_x(inp, count=0):
	for i in range(len(inp) - 1):
		if inp[i] == inp[i + 1]:
			del inp[i]
			count += 1
			return remove_x(inp, count)
	return count
n = remove_x(list(string))
print(n)


def getStonesCount(inStones):
	count = 0
	stones = inStones
	for s in ['RR', 'GG', 'BB']:
		while stones.find(s) >= 0:
			stones = stones.replace(s, s[0], 1)
			count += 1
	return count
(n, stones) = (input(), input())
print(getStonesCount(stones))


n = int(input())
s = input()

def check(s):
	s = list(s)
	c = 0
	for i in range(1, len(s)):
		if s[i] == s[i - 1]:
			c += 1
	return c
print(check(s))


n = int(input())
colours = input()
s = 0
list_colours = list(colours)
for i in range(0, len(list_colours)):
	if i < len(list_colours) - 1:
		if list_colours[i] == list_colours[i + 1]:
			s = s + 1
print(s)


def main():
	a = 0
	input()
	s = input()
	for i in range(1, len(s)):
		a += s[i - 1] == s[i]
	print(a)
main()


n = int(input())
st = input()
lis = [i for i in st]
co = 0
col = lis[0]
for color in lis:
	if color == col:
		co += 1
		col = color
	else:
		col = color
print(co - 1)


n = int(input())
colors = list(input())
total = 0
for i in range(n):
	previous = colors[i]
	if i != 0:
		if colors[i] == colors[i - 1]:
			total += 1
print(total)


temp = input()
stones = input()
borders = 0
for i in range(0, len(stones)):
	if i < len(stones) - 1 and stones[i] == stones[i + 1]:
		borders += 1
print(borders)


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


n = int(input())
c = input()
l = list(c)
l_copy = l[:]
for i in range(n - 1, 0, -1):
	if l[i] == l[i - 1]:
		l_copy.remove(l[i])
print(len(l) - len(l_copy))


n = int(input())
s = input()
sl = [i for i in s]
f = 1
ans = 0
while f == 1:
	f = 0
	for i in range(1, len(sl)):
		if sl[i] == sl[i - 1]:
			sl.pop(i)
			ans += 1
			f = 1
			break
print(ans)


while True:
	try:
		n = int(input())
		s = list(input())
		previous = s[0]
		repeated_counter = 0
		for current in s[1:]:
			current
			if current == previous:
				repeated_counter += 1
			previous = current
		print(repeated_counter)
	except EOFError:
		break


n = int(input())
stones = input()
for_removal = 0
prev_stone = '?'
for stone in stones:
	if stone == prev_stone:
		for_removal += 1
	else:
		prev_stone = stone
print(for_removal)


from sys import stdin
(lines, line_index) = (stdin.readlines(), -1)

def get_line():
	global lines, line_index
	line_index += 1
	return lines[line_index]

def main():
	n = int(get_line())
	s = get_line().strip()
	counter = 0
	p = s[0]
	i = 1
	while i < n:
		if p == s[i]:
			counter += 1
		p = s[i]
		i += 1
	print(counter)
main()


n = int(input())
l = list(input())
cnt = 0
for i in range(n):
	for j in range(len(l) - 1):
		if j + 1 < len(l) and l[j] == l[j + 1]:
			l.pop(j + 1)
			cnt += 1
print(cnt)


n = int(input())
color_of_stones = input()
colors = []
for i in color_of_stones:
	colors.append(i)
co = 0
no_remove = 0
for eq in range(n):
	try:
		if colors[co] == colors[co + 1]:
			colors.pop(co)
			no_remove += 1
		else:
			co += 1
	except IndexError:
		pass
print(no_remove)


ns = int(input().strip())
ss = input().strip()
sr = 0
ps = ''
for sc in ss:
	if sc == ps:
		sr = sr + 1
	ps = sc
print(sr)


def main():
	length = int(input())
	seq = list(input())
	count = 0
	for i in range(length - 1):
		if seq[i] == seq[i + 1]:
			count += 1
	print(count)
main()


x = 0
n = int(input())
a = list(input())
i = 0
while i < n - 1:
	if a[i] == a[i + 1]:
		del a[i + 1]
		x = x + 1
		n = n - 1
	else:
		i = i + 1
print(x)


n = int(input())
stones = input()
counter = 0
for i in range(1, len(stones) + 1):
	if i == len(stones):
		break
	elif stones[i] == stones[i - 1]:
		counter += 1
	else:
		continue
print(counter)


N = int(input())
A = input()
ans = 0
if A[0] == 'R':
	flag = 0
elif A[0] == 'G':
	flag = 1
else:
	flag = 2
for i in range(1, N):
	if A[i] == 'R' and flag == 0:
		ans += 1
	if A[i] == 'G' and flag == 1:
		ans += 1
	if A[i] == 'B' and flag == 2:
		ans += 1
	if A[i] == 'R':
		flag = 0
	elif A[i] == 'G':
		flag = 1
	else:
		flag = 2
print(ans)


num = int(input())
s = input()
a = 0
for i in range(len(s) - 1):
	if s[i] == s[i + 1]:
		a += 1
	elif len(s) == 1:
		a = 0
print(a)


l = input()
a = input()
c = a[0]
b = 0
for char in a[1:]:
	if char == c:
		b = b + 1
	c = char
print(b)


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


input()
s = input()
newList = []
for i in s:
	if len(newList) == 0 or i != newList[-1]:
		newList.append(i)
print(len(s) - len(newList))


n = int(input())
l = list(input().lower())
cnt = 0
for i in range(1, len(l)):
	if l[i] == l[i - 1]:
		l[i - 1] = i
		cnt += 1
print(cnt)


(_, s) = (input(''), input(''))
(g, maxg) = (0, 0)
for i in range(1, len(s)):
	if s[i] == s[i - 1]:
		g += 1
	if g > maxg:
		maxg = g
print(maxg)


import sys
input = sys.stdin.readline

def gl():
	return input()

def gli():
	return int(input())

def gls():
	return input().split()

def glm():
	return list(map(int, input().split()))
n = gli()
s = gl()
a = 0
for i in range(n - 1):
	if s[i] == s[i + 1]:
		a += 1
print(a)


def delete(word, index):
	return word[:index] + word[index + 1:]
input()
w = input()
x = 0
ans = 0
while x < len(w) - 1:
	if w[x] == w[x + 1]:
		ans += 1
		w = delete(w, x + 1)
	else:
		x += 1
print(ans)


n = int(input())
s = input()
(r, b, g) = ([], [], [])
sb = sg = sr = 0
for i in s:
	if i == 'R':
		sr = sr + 1
		b.append(sb)
		g.append(sg)
		sb = sg = 0
	elif i == 'G':
		sg = sg + 1
		b.append(sb)
		r.append(sr)
		sr = sb = 0
	elif i == 'B':
		sb = sb + 1
		g.append(sg)
		r.append(sr)
		sr = sg = 0
r.append(sr)
b.append(sb)
g.append(sg)
s = 0
for i in r:
	if i != 0:
		s = s + i - 1
for i in b:
	if i != 0:
		s = s + i - 1
for i in g:
	if i != 0:
		s = s + i - 1
print(s)


x = int(input())
k = list(input())
stone = k[0]
count = 0
test = 0
for i in range(1, x):
	if k[i] == stone:
		count += 1
	else:
		stone = k[i]
print(count)


n = int(input())
str1 = input()
list1 = [x for x in str1]
count = 0
x = 0
for x in range(n - 1):
	if list1[x] == list1[x + 1]:
		count += 1
print(count)


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


n = int(input())
s = input()
k = [s[0]]
for i in s[1:]:
	if k[len(k) - 1] != i:
		k.append(i)
print(n - len(k))


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


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


l = lambda : input()
n = int(l())
s = l()
nos = 0
for c in range(n - 1):
	if s[c] == s[c + 1]:
		nos += 1
print(nos)


n = int(input())
line = input()
array = list(line)
aux = 0
count = 0
while aux < n - 1:
	if array[aux] == array[aux + 1]:
		count += 1
	aux += 1
print(count)


numberOfStones = int(input())
stoneRow = [stone for stone in input()]
originalStoneRow = stoneRow
stoneReference = stoneRow[0]
stoneIndex = 1
for i in range(numberOfStones - 1):
	newStone = stoneRow[stoneIndex]
	if newStone == stoneReference:
		stoneRow[stoneIndex] = ' '
	else:
		stoneReference = newStone
	stoneIndex += 1
stoneRow = [i for i in stoneRow if i != ' ']
print(len(originalStoneRow) - len(stoneRow))


x = int(input())
l = input()
count = 0
for i in range(x):
	if i > 0 and l[i] == l[i - 1]:
		count = count + 1
print(count)


n = int(input())
a = input()
before = ''
count = 0
for i in a:
	if before == i:
		count += 1
	if i == 'R':
		before = 'R'
	elif i == 'G':
		before = 'G'
	else:
		before = 'B'
print(count)


number = int(input())
lst = []
string = input()
lst = list(string)
s = 0
for i in range(len(lst) - 1):
	if lst[i] == lst[i + 1]:
		s += 1
print(s)


no = int(input())
string = list(input())
remove = 0
prev_char = ''
for i in range(no):
	char = string.pop()
	if char == prev_char:
		remove += 1
	else:
		prev_char = char
print(remove)


def sol(n):
	count = 0
	stones = input()
	if n == 1:
		return count
	for i in range(0, len(stones) - 1):
		if stones[i] == stones[i + 1]:
			count += 1
		else:
			continue
	return count
n = int(input())
print(sol(n))


input()
s = input()
r = 0
previous = 0
for i in range(1, len(s)):
	if s[i] == s[previous]:
		r += 1
	else:
		previous = i
print(r)


x = int(input())
color = str(input())
if x > 0:
	c = color[0]
i = -1
s = 0
chck = 0
for j in range(x):
	if color[j] != c:
		s = s + i
		c = color[j]
		i = -1
	i = i + 1
if i != -1 and i != 0:
	s = s + i
for k in range(x):
	if c == color[k]:
		chck = chck + 1
if chck == x and x != 0:
	s = x - 1
print(s)


n = int(input())
word = input()
x = 0
re = 0
for i in range(n - 1):
	if word[i] == word[i + 1]:
		re += 1
print(re)


n = int(input())
chars = list(input())
change = 0
for i in range(n - 1):
	if chars[i] == chars[i + 1]:
		change += 1
print(change)


number_of_stones = int(input())
stones = input()
counter = 0
error = True
while error:
	error = False
	for i in range(len(stones) - 1):
		if len(stones) > 1:
			if stones[i] == stones[i + 1]:
				stones = stones[:i] + stones[i + 1:]
				counter += 1
				error = True
				break
print(counter)


len = int(input())
str = input()
l = ''
ans = 0
for i in str:
	if l == i:
		ans += 1
	else:
		l = i
print(ans)


n = int(input())
s = input()
(count, i) = (0, 0)
while True:
	(r, b, g) = ('RR', 'BB', 'GG')
	if r in s:
		a = s.index(r)
	elif b in s:
		a = s.index(b)
	elif g in s:
		a = s.index(g)
	else:
		break
	s = s[:a] + s[a + 1:]
	count += 1
print(count)


n = int(input())
c = list(input())
t = 0
for i in range(n - 1):
	if c[i] == c[i + 1]:
		t += 1
	else:
		t += 0
print(t)


n = int(input())
stnclr2 = list()
stnclr1 = input().upper()
for i in stnclr1:
	stnclr2.append(i)
remcount = 1
for i in range(n - 1):
	current = stnclr2[i]
	past = stnclr2[i + 1]
	if current != past:
		remcount = remcount + 1
print(n - remcount)


input()
a = input()
print(sum([x == y for (x, y) in zip(a, a[1:])]))


(n, string) = (input(), input())
i = 0
result = 0
loop = True

def make_result(i):
	global result
	for s in string[i:]:
		for check_s in string[i + 1:]:
			if s == check_s:
				result += 1
				i += 1
			else:
				return (i + 1, True)
	return (0, False)
while loop:
	(i, loop) = make_result(i)
print(result)


n = int(input())
string = list(input())
pos = 1
result = 0
while pos < n:
	if string[pos] == string[pos - 1]:
		del string[pos]
		result += 1
		n -= 1
	else:
		pos += 1
print(result)


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


t = int(input())
stones = input()
count = 0
for num in range(len(stones) - 1):
	if stones[num] == stones[num + 1]:
		count += 1
	else:
		pass
print(count)


import sys

def main():
	while True:
		try:
			n = int(sys.stdin.readline().rstrip())
			stones = sys.stdin.readline().rstrip()
			stones_list = list(stones)
			before_color = None
			total = 0
			flag = True
			while flag:
				try:
					color = stones_list.pop(0)
					if before_color == color:
						total += 1
					before_color = color
				except IndexError:
					flag = False
			print(total)
		except ValueError:
			break
main()


n = input()
m = str(input())
line = list(m)
x = 0
for i in range(len(m) - 1):
	if line[i] == line[i + 1]:
		x = x + 1
print(x)


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


num_input = int(input())
seq_input = list(input())
new_seq = []
new_seq.append(seq_input[0])
for x in seq_input[1:]:
	if x != new_seq[-1]:
		new_seq.append(x)
print(len(seq_input) - len(new_seq))


n = int(input())
m = input()
stone = 0
i = 0
while i < len(m) - 1:
	if m[i] == m[i + 1]:
		stone += 1
	i = i + 1
print(stone)


n = int(input())
colors = input()
r = 0
c = colors[0]
for x in colors[1:]:
	if x == c:
		r += 1
	c = x
print(r)


def main():
	from sys import stdout
	inp = int(input())
	inp2 = input()
	first = ''
	res = 0
	for el in inp2:
		if el == first:
			res += 1
		first = el
	stdout.write(str(res))
main()


input()
a = list(input())
(r, i) = (0, 0)
while i < len(a) - 1:
	if a[i] == a[i + 1]:
		del a[i]
		r = r + 1
	else:
		i = i + 1
print(r)


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


import sys

def main():
	n = int(sys.stdin.readline())
	colors = sys.stdin.readline().strip()
	cnt = 0
	for (p, c) in zip(colors, colors[1:]):
		if p == c:
			cnt += 1
	print(cnt)
main()


n = int(input())
data = input()
prev = 0
cur = 1
size = len(data)
cnt = 0
while cur < size:
	if data[prev] == data[cur]:
		cur += 1
		cnt += 1
	else:
		prev = cur
		cur += 1
print(cnt)


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


stonesNumber = int(input())
stonesColor = input()
finalColor = 0
tmpColor = ''
for i in stonesColor:
	if i != tmpColor:
		finalColor += 1
		tmpColor = i
print(stonesNumber - finalColor)


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


x = int(input())
resultado = 0
text = input()
for c in range(len(text) - 1):
	if text[c] == text[c + 1]:
		resultado += 1
	else:
		continue
print(resultado)


length = int(input())
stones = str(input())
list_of_stones = []
for x in stones:
	list_of_stones.append(x)
count = 0
for i in range(len(stones) - 1):
	if list_of_stones[i] == list_of_stones[i + 1]:
		count = count + 1
print(count)


z = input()
a = input()
somme = 0
for i in range(1, len(a)):
	if a[i] == a[i - 1]:
		somme += 1
print(somme)


input()
Str = input()
las = ans = 0
for Stn in Str:
	if Stn == las:
		ans += 1
	las = Stn
print(ans)


(n, y) = (int(input()), input())
i = 0
k = 0
while i < n - 1:
	if y[i] == y[i + 1]:
		k += 1
	i += 1
print(k)


i = input()
i = int(i)
k = input()
kon = int(0)
while i > 1:
	if k[i - 1] == k[i - 2]:
		kon += 1
	i -= 1
print(kon)


a = input()
cnt = 0
for c in input():
	if a == c:
		cnt += 1
	a = c
print(cnt)


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


n = int(input())
s = input()
s = [c for c in s]
i = 0
count = 0
while i < len(s) - 1:
	if s[i] == s[i + 1]:
		del s[i]
		count = count + 1
	else:
		i = i + 1
print(count)


n = input()
s = input()
d = 0
if len(s) == 2 and s[0] == s[1]:
	print(1)
	exit()
if len(s) > 1:
	if s[0] == s[1]:
		d += 1
	if s[len(s) - 1] == s[len(s) - 2]:
		d += 1
for i in range(1, len(s) - 2):
	if s[i] == s[i + 1]:
		d += 1
print(d)


x = int(input())
ch = input()
a = 0
for i in range(x - 1):
	if ch[i] == ch[i + 1]:
		a += 1
print(a)


n = int(input())
s = input().upper()
if len(s) != n:
	raise ValueError
count = 0
for i in range(n - 1):
	if 'RR' in ''.join(list(s[i:i + 2])):
		count += 1
	elif 'BB' in ''.join(list(s[i:i + 2])):
		count += 1
	elif 'GG' in ''.join(list(s[i:i + 2])):
		count += 1
print(count)


input()
s = input()
count = 0
for (i, ch) in enumerate(s[:-1]):
	if s[i + 1] == ch:
		count += 1
print(count)


n = input()
word = input()
wlst = []
for i in range(len(word) - 1):
	if word[i] == word[i + 1]:
		wlst.append(i + 1)
print(len(wlst))


n = int(input())
s = input()
l = []
count = 0
c = 0
l.append(s[0])
for x in range(1, n):
	if s[x] == l[c]:
		count += 1
	else:
		c += 1
		l.append(s[x])
print(count)


prev = ''
increments = 0
throwaway = input()
stones = list(input())
for x in stones:
	if bool(prev) and prev == x:
		increments += 1
	prev = x
print(increments)


def finder(arr, x, out):
	if x == len(arr) - 1:
		print(out)
		return
	if arr[x] is arr[x + 1]:
		arr.remove(arr[x])
		finder(arr, x, out + 1)
	else:
		finder(arr, x + 1, out)
input()
a = input()
a = [str(i) for i in a]
finder(a, 0, 0)


input()
s = input()
c = 0
b = 'a'
for i in s:
	if b == i:
		c += 1
	b = i
print(c)


n = int(input())
c = 0
m = list(map(str, input()))
for i in range(len(m) - 1):
	if m[i] == m[i + 1]:
		c += 1
print(c)


number_of_stones = input()
stones = input()
stones_moved = 0
for i in range(0, len(stones) - 1):
	if stones[i] == stones[i + 1]:
		stones_moved = stones_moved + 1
print(stones_moved)


n = int(input())
stones = input()
l = [ord(x) for x in stones]
res = 0
for i in range(len(l) - 1):
	if l[i] == l[i + 1]:
		res += 1
print(res)


n = int(input())
a = list(input())
kol = 0
i = 0
while i < len(a) - 1:
	if a[i] == a[i + 1]:
		a.remove(a[i])
		kol += 1
		i -= 1
	i += 1
print(kol)


from sys import stdin, stdout
number_of_stones = int(stdin.readline())
stones = stdin.readline()
prev = stones[0]
res = 0
i = 1
while i < number_of_stones:
	if prev == stones[i]:
		res += 1
	prev = stones[i]
	i += 1
print(res)


n = int(input())
l = input().lstrip().rstrip()
cnt = 0
d = 0

def is_unique(ls):
	if len(ls) <= 1:
		return True
	init = ls[0]
	for i in range(1, len(ls)):
		if init == ls[i]:
			return False
		init = ls[i]
	return True
cop = l
while not is_unique(cop):
	if cop[d] == cop[d + 1]:
		cop = cop[:d + 1] + cop[d + 2:]
		cnt += 1
	else:
		d += 1
print(cnt)


n = input()
s = input()
count = 0
pre_stone = 'w'
for i in s:
	if i == pre_stone:
		count = count + 1
	else:
		pre_stone = i
print(count)


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


n = int(input())
data = input()
(previous, ans) = ('', 0)
for i in data:
	if i == previous:
		ans += 1
	else:
		previous = i
print(ans)


input()
s = list(input())
i = 0
j = 0
while i < len(s) - 1:
	if s[i] == s[i + 1]:
		del s[i]
		j += 1
	else:
		i += 1
print(j)


n = input()
s = input()
start_index = -1
last_color = ''
stones_to_remove = 0
for current_color in s:
	if current_color == last_color:
		stones_to_remove += 1
	else:
		last_color = current_color
print(stones_to_remove)


import array as a
n = int(input())
s = a.array('u', list(input()))
i = 0
c = 0
while i < len(s) - 1:
	if s[i] == s[i + 1]:
		del s[i]
		c += 1
		i -= 1
	i += 1
print(c)


n = input()
c = input()
prev = 'I'
count = 0
for i in c:
	if prev == i:
		count += 1
	prev = i
print(count)


from sys import stdin, stdout
inp = stdin.readline
out = stdout.write
n = int(inp().strip())
s = inp().strip()
c = 0
for i in range(1, n):
	if s[i] == s[i - 1]:
		c += 1
out(str(c))


n = int(input())
z = [a for a in input()]
cp = z[:]
for i in range(0, len(z) - 1):
	if (z[i] == 'R' or z[i] == 'G' or z[i] == 'B') and z[i] == z[i + 1]:
		z[i] = '0'
	else:
		continue
print(z.count('0'))


n = int(input())
line = list(input())
count = 1
for i in range(len(line) - 1):
	(x, y) = line[i:i + 2]
	if x != y:
		count += 1
print(n - count)


n = int(input())
string = input()
num_string = ''
char = 0
ans = 0
for i in string:
	if i == char:
		ans += 1
	char = i
print(ans)


x = int(input())
w = input()
result = 0
for y in range(0, len(w) - 1):
	if w[y] == w[y + 1]:
		result += 1
print(result)


(n, s) = (input(), input())
count = 0
sc = 0
for i in range(len(s) - 1):
	if s[i] == s[i + 1]:
		count += 1
		if count >= 1:
			sc += 1
	else:
		count = 0
print(sc)


a = input()
b = input()
c = []
d = 0
for i in b:
	c.append(i)
for i in range(1, len(c)):
	if c[i] == c[i - 1]:
		d += 1
print(d)


try:
	n = int(input())
	s = input()[:n]
	c = 0
	for i in range(n - 1):
		if s[i] == s[i + 1]:
			c += 1
	print(c)
	pass
except Exception:
	pass


n = int(input())
s = list(map(str, input()))
c = 0
for i in range(len(s) - 1):
	if s[i] == s[i + 1] and i == 0:
		k = list({'R', 'G', 'B'} - {s[i + 1]})
		s[i] = k[0]
		c += 1
	if s[i] == s[i + 1] and i != 0:
		k = list({'R', 'G', 'B'} - {s[i - 1], s[i + 1]})
		s[i] = k[0]
		c += 1
print(c)


t = int(input())
word = input()
r = 0
g = 0
b = 0
for i in range(t - 1):
	if word[i] == 'R' and word[i + 1] == 'R':
		r += 1
		continue
	if word[i] == 'G' and word[i + 1] == 'G':
		g += 1
		continue
	if word[i] == 'B' and word[i + 1] == 'B':
		b += 1
		continue
print(r + b + g)


a = input()
a = input()
c = 0
r = 1
b = 1
g = 1
while r or b or g:
	if a.find('RR') != -1:
		r = 1
		a = a.replace('RR', 'R', 1)
		c += 1
	else:
		r = 0
	if a.find('GG') != -1:
		g = 1
		a = a.replace('GG', 'G', 1)
		c += 1
	else:
		g = 0
	if a.find('BB') != -1:
		b = 1
		a = a.replace('BB', 'B', 1)
		c += 1
	else:
		b = 0
print(c)


n = int(input())
string = input()
c = 0
for i in range(n):
	if n > 1 and i > 0 and (string[i] == string[i - 1]):
		c += 1
print(c)


n = int(input())
stone = input()
r = 0
(i, j) = (0, 1)
jump = 0
while j < n:
	if stone[i] == stone[j]:
		r += 1
		j += 1
		jump += 1
		continue
	i += jump + 1
	j += 1
	jump = 0
print(r)


import sys
firstline = True
total = 0
numlines = 2
for line in sys.stdin:
	if firstline:
		n = int(line)
		numlines -= 1
		firstline = False
		continue
	for i in range(n):
		if line[i] == line[i + 1]:
			total += 1
	numlines -= 1
	if numlines == 0:
		break
print(total)


N = int(input())
colors = input()
sol = 0
for i in range(N - 1):
	if colors[i] == colors[i + 1]:
		sol += 1
print(sol)


n = int(input())
s = input()
l = list(s)
j = 0
count = 0
while j != len(l) - 1:
	if l[j] == l[j + 1]:
		del l[j]
		count += 1
	else:
		j = j + 1
print(count)


n = int(input())
string = input()
print(sum((string[i] == string[i - 1] for i in range(1, len(string)))))


input()
stones = input()
print(sum((stones[i] == stones[i - 1] for i in range(1, len(stones)))))


times = int(input())
q = input()
t = 0
i = 0
while i < times - 1:
	if ord(q[i]) == ord(q[i + 1]):
		t = t + 1
	else:
		t = t
	i = i + 1
print(t)


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


n = int(input())
s = str(input())
c = 0
for i in range(len(s) - 1):
	if s[i] == s[i + 1]:
		c = c + 1
	else:
		pass
print(c)


b = input()
a = input()
con = 0
for i in range(0, len(a)):
	if i == 0:
		if a[i] == 'R':
			stat = 1
		elif a[i] == 'G':
			stat = 2
		else:
			stat = 3
	elif a[i] == 'R':
		if stat == 1:
			con += 1
		else:
			stat = 1
	elif a[i] == 'G':
		if stat == 2:
			con += 1
		else:
			stat = 2
	elif stat == 3:
		con += 1
	else:
		stat = 3
print(con)


try:
	n = int(input())
	if n >= 1 and n <= 50:
		take = input()
		counter = 0
		if len(take) == n:
			for i in range(len(take)):
				if i <= len(take) - 2:
					if take[i] == take[i + 1]:
						counter += 1
			print(counter)
except Exception as e:
	print(e)


from sys import stdin

def readInts():
	return map(int, stdin.readline().strip().split())

def solve(s):
	prev = None
	remove = 0
	for c in s:
		if c != prev:
			prev = c
		else:
			remove += 1
	return remove

def run():
	(n,) = readInts()
	print(solve(stdin.readline().strip()))
run()


a = input()
b = list(input())
remove = 0
for i in range(len(b) - 1):
	if b[i] == b[i + 1]:
		remove += 1
	else:
		pass
print(remove)


n = int(input())
s = input()
flag = 0
cnt = 0
prev = ''
for c in s:
	if c == prev:
		flag = 1
	else:
		flag = 0
	prev = c
	if flag == 1:
		cnt += 1
print(cnt)


from itertools import groupby
l = input()
s = groupby(input())
print(sum([sum((1 for _ in group)) - 1 for (label, group) in s]))


def string_to_list(string, character_length):
	string_to_list = []
	for i in range(0, int(character_length)):
		string_to_list.append(string[i])
	return string_to_list

def process_stones(stone_list):
	neighbors = 0
	for i in range(0, len(stone_list) - 1):
		if stone_list[i] == stone_list[i + 1]:
			neighbors = neighbors + 1
	return neighbors
number_of_stones = input()
stones = input()
stone_list = []
stone_list = string_to_list(stones, number_of_stones)
print(process_stones(stone_list))


N = int(input())
N1 = input()
count = 0
for i in range(N - 1):
	if N1[i] == N1[i + 1]:
		count += 1
print(count)


n = int(input())
str = input()
sum = 0
for i in range(n - 1):
	if str[i] == str[i + 1]:
		sum = sum + 1
print(sum, end='')


import sys
n = 0
a = 0
tArr = []
for l in sys.stdin:
	if n == 0:
		n = n + 1
	else:
		for k in l:
			tArr.append(k)
		tArr.pop()
		break
while n != 0:
	prev = ''
	n = n + 1
	if n > 75:
		break
	for (i, k) in enumerate(tArr):
		if k == prev:
			del tArr[i]
			a = a + 1
			break
		prev = k
print(a)


import sys

def stones_to_remove(stones):
	c = 0
	prev = None
	for stone in stones:
		if prev is None:
			pass
		elif prev == stone:
			c = c + 1
		prev = stone
	return c

def main(args):
	lines = sys.stdin.readlines()
	n = int(lines[0])
	print(stones_to_remove(lines[1].strip()))
main(sys.argv)


def gogo(ls):
	c = 0
	if len(ls) == 1:
		return c
	for i in range(1, len(ls)):
		if ls[i - 1] == ls[i]:
			c += 1
	return c
t = int(input())
ls = list(input())
print(gogo(ls))


n = int(input())
a = input()
temp = count = flag = 0
for i in range(1, n):
	if a[i] == a[i - 1]:
		temp += 1
		if i == n - 1:
			count += temp
	elif a[i] != a[i - 1] or i == n - 1:
		count += temp
		temp = 0
		flag = 1
if flag == 1:
	print(count)
else:
	print(temp)


(n, s) = (int(input()), input())
i = n
while len(s) > 1:
	s = s.replace('BB', 'B').replace('RR', 'R').replace('GG', 'G')
	j = len(s)
	if j == i:
		break
	i = j
print(n - len(s))


k = int(input())
l = input()
list1 = []
for i in range(k - 1):
	if l[i] == l[i + 1]:
		list1.append(l[i])
print(len(list1))


size = int(input())
stones = input()
print(size - len([curr for (count, curr) in enumerate(stones) if count == 0 or curr != stones[count - 1]]))


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


numberOfStones = int(input())
pervious = ''
Next = ''
result = 0
row = input()
for i in range(numberOfStones):
	if pervious == row[i]:
		result += 1
	pervious = row[i]
print(result)


col = int(input())
c = input()
a = 0
i = 0
while i < len(c) - 1:
	if c[i] == c[i + 1]:
		a += 1
	i += 1
print(a)


n = int(input())
table = str(input())
answer = 0
for i in range(n):
	if i == n - 1:
		pass
	elif table[i] == table[i + 1]:
		answer += 1
print(answer)


import re
(l, inp) = (input(), input())
tmp = len(inp)
inp = re.sub('([A-Z])\\1+', '\\1', inp)
print(tmp - len(inp))


n = int(input())
stones = input()
prev = stones[0]
sum = 0
for i in range(1, len(stones)):
	if prev == stones[i]:
		sum += 1
	else:
		prev = stones[i]
print(sum)


stone_amount = int(input())
stones = list(input())
total = 0
current = 0
for i in range(1, stone_amount):
	if stones[current] == stones[i]:
		total += 1
	current = i
print(total)


N = int(input())
M = input()
if 1 <= N <= 50:
	i = 0
	s = 0
	while i < len(M) - 1:
		if M[i] == M[i + 1]:
			s += 1
		i += 1
print(s)


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


from sys import stdin
stdin.readline()
stones = stdin.readline().strip()
ans = 0
for i in range(1, len(stones)):
	if stones[i - 1] == stones[i]:
		ans += 1
print(ans)


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


number_of_stones = int(input())
stone_colors = list(input())
count = 0
current = stone_colors[0]
for number in range(1, number_of_stones):
	if stone_colors[number] == current:
		count += 1
	else:
		current = stone_colors[number]
print(count)


input()
s = tuple(input())
x = 0
c = ''
for i in s:
	if i == c:
		x += 1
	c = i
print(x)


n = int(input())
stones = input().strip()
row = 0
for i in range(1, n):
	if stones[i] == stones[i - 1]:
		row += 1
print(row)


number = int(input())
colors = input()
counter = 0
for i in range(number - 1):
	if colors[i] == colors[i + 1]:
		counter += 1
print(counter)


n = int(input())
s = input()
m = 0
while 'RR' in s or 'GG' in s or 'BB' in s:
	i = -1
	if 'RR' in s:
		i = s.index('RR')
	elif 'GG' in s:
		i = s.index('GG')
	elif 'BB' in s:
		i = s.index('BB')
	if i > -1:
		s = s[:i] + s[i + 1:]
		m += 1
print(m)


t = int(input())
c = input()
print(sum((c[i] == c[i + 1] for i in range(0, t - 1))))


n = int(input())
st = input()
count = 0
i = 0
while i < n:
	while i < n and i + 1 < n and (st[i] == st[i + 1]):
		i = i + 1
		count += 1
	i += 1
print(count)


n = int(input())
s = input()
cur_char = s[0]
count = 0
for i in s[1:]:
	if cur_char == i:
		count += 1
	else:
		cur_char = i
print(count)


def func(n, s):
	count = 0
	l1 = list(map(str, s))
	for i in range(n - 1):
		if l1[i] == l1[i + 1]:
			count += 1
		elif l1[i] != l1[i + 1]:
			continue
	return count
print(func(int(input()), input()))


def solver(text):
	cnt = 0
	for i in range(len(text) - 1):
		if text[i] == text[i + 1]:
			cnt += 1
	return cnt
n = int(input())
print(solver(input()))


def stone_on_table():
	n = int(input())
	stones = input().upper()
	if n > 50 or n < 1 or len(stones) != n:
		return
	for i in stones:
		if i != 'R' and i != 'B' and (i != 'G'):
			return
	count = 0
	for i in range(len(stones) - 1):
		if stones[i] == stones[i + 1]:
			count += 1
	print(count)
stone_on_table()


n = int(input())
s = str(input())
unique = s[0]
l = []
l.append(s[0])
for i in range(1, n):
	if s[i] != unique:
		l.append(s[i])
		unique = s[i]
length = len(s) - len(l)
print(length)


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


x = input
q = int(x())
c = x()
count = 0
for i in range(1, q):
	if c[i] == c[i - 1]:
		count += 1
print(count)


length = int(input())
data = list(input())
count = 0
for i in range(len(data) - 1):
	if data[i] == data[i + 1]:
		count += 1
print(count)


nax = input()
s = list(input())
do = 0
c = -1
while True:
	if do != c:
		c = do
		for x in range(len(s)):
			try:
				if s[x] == s[x + 1]:
					del s[x + 1]
					do += 1
			except IndexError:
				continue
	else:
		break
print(do)


input()
s = input()
moves = 0
while 'RR' in s or 'GG' in s or 'BB' in s:
	if 'RR' in s:
		pos = s.index('RR')
		s = s[:pos] + s[pos + 1:]
		moves += 1
	if 'GG' in s:
		pos = s.index('GG')
		s = s[:pos] + s[pos + 1:]
		moves += 1
	if 'BB' in s:
		pos = s.index('BB')
		s = s[:pos] + s[pos + 1:]
		moves += 1
print(moves)


input()
que = list(input())
ptr = 0
count = 0
while ptr < len(que):
	if ptr + 1 == len(que):
		break
	if que[ptr] == que[ptr + 1]:
		que.remove(que[ptr + 1])
		count += 1
	else:
		ptr += 1
print(count)


import sys
n = int(sys.stdin.readline().split()[0])
s = list(sys.stdin.readline())[:-1]
stones = 0
i = 0
while i < len(s):
	if i != len(s) - 1:
		if s[i] == s[i + 1]:
			stones += 1
	i += 1
print(stones)


def main():
	t = input()
	a = str(input())
	cnt = 0
	i = 0
	while i < len(a):
		j = i + 1
		while j < len(a) and a[j] == a[i]:
			j += 1
		j -= 1
		cnt += j - i
		i = j + 1
	print(cnt)
main()


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)


y = int(input())
x = input()
z = 0
for i in range(1, len(x)):
	if x[i] == 'R' and x[i - 1] == 'R' or (x[i] == 'B' and x[i - 1] == 'B') or (x[i] == 'G' and x[i - 1] == 'G'):
		z += 1
print(z)


_ = input()
s = input()
curr = s[0]
count = 0
for l in s[1:]:
	if l == curr:
		count += 1
	else:
		curr = l
print(count)


(n, a) = (int(input()), 0)
s = str(input())
for i in range(int(n)):
	if 'RR' in s:
		s = s.replace('RR', 'R', 1)
		a += 1
	if 'BB' in s:
		s = s.replace('BB', 'B', 1)
		a += 1
	if 'GG' in s:
		s = s.replace('GG', 'G', 1)
		a += 1
print(a)


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


n = int(input())
stones = input()
count = 0
count_plus = 0
flag = stones[0]
for i in range(1, n):
	if stones[i] == flag:
		count = count + 1
	else:
		flag = stones[i]
print(count)


_ = input()
word = input()
num = 0
for i in range(1, len(word)):
	if word[i] == word[i - 1]:
		num += 1
print(num)


stones = int(input(''))
colorsOfStones = input('')
sayac = 0
for i in range(0, stones - 1):
	text = colorsOfStones[i:i + 2]
	if text[0] == text[1]:
		sayac += 1
		text = colorsOfStones[i + 1:]
print(sayac)


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


(_, n) = (input(), input())
print(sum((1 for i in range(1, len(n)) if n[i] == n[i - 1])))


n = int(input())
m = input()
a = m[0]
s = 'a'
for i in m:
	if a != i:
		s = s + i
	a = i
print(n - len(s))


v1 = int(input())
v2 = str(input())
listofzeros = [0] * v1
for i in range(v1):
	if i > 0:
		if v2[i] == v2[i - 1]:
			listofzeros[i] = listofzeros[i - 1] + 1
			listofzeros[i - 1] = 0
a = 0
for i in listofzeros:
	a = i + a
print(a)


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


n = input()
s = input()
cur = s[0]
c = 0
for i in range(1, len(s)):
	if s[i] is cur:
		c += 1
	else:
		cur = s[i]
print(c)


n = int(input())
s = input()
s = list(s)
count = 0
for i in range(len(s)):
	if i == len(s) - 1:
		break
	if s[i] == '-':
		continue
	j = i + 1
	while s[i] == s[j]:
		s[j] = '-'
		j = j + 1
		count = count + 1
		if j == len(s):
			break
print(count)


T = int(input())
S = input()
K = ' '
R = 0
for I in range(T):
	if S[I] != K[-1]:
		K += S[I]
	else:
		R += 1
print(R)


n = input()
sc = input()
l = []
for i in sc:
	l.append(i)
c = 0
for i in range(len(l)):
	for j in range(i, len(l)):
		if l[i] == l[j] and j - i == 1:
			c += 1
print(c)


def number(n, lst):
	x = 0
	for i in range(0, n - 1):
		if lst[i] == lst[i + 1]:
			x += 1
	return x
x = int(input())
str = input()
print(number(x, str))


n = int(input())
s = input()
arr = list(s)
i = 0
l = 0
r = 1
if n == 1:
	print(0)
else:
	ans = 0
	while i != n - 1:
		if arr[l] == arr[r]:
			del arr[r]
			ans += 1
		else:
			l += 1
			r += 1
		i += 1
	print(ans)


cnt = int(input())
a = list(input())
ans = 0
for i in range(0, cnt - 1):
	if a[i] == a[i + 1]:
		ans += 1
print(ans)


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


n = input()
m = input()
count = 0
t = 0
while t == 0:
	exists = 1
	if len(m) == 1:
		break
	for i in range(len(m) - 1):
		if m[i] == m[i + 1]:
			m = m[:i] + m[i + 1:]
			count += 1
			exists = 0
			break
	if exists == 1:
		break
print(count)


a = input()
b = input()
count = 0
pre = ''
for i in b:
	if i == pre:
		count += 1
		pass
	else:
		pre = i
		pass
print(count)


n = int(input())
stones = input()
L = [stones[0]]
for i in range(1, n):
	if stones[i] != L[-1]:
		L.append(stones[i])
print(n - len(L))


n = input()
n = int(n)
s = input()
i = 0
total = 0
while i < n - 1:
	if s[i] == s[i + 1]:
		total = total + 1
	i = i + 1
print(f'{total}')


import sys
import math as mt
input = sys.stdin.buffer.readline
t = 1
for __ in range(t):
	n = int(input())
	s = input()
	x = s[0]
	(cnt, ans) = (1, 0)
	for i in range(1, n):
		if s[i] == x:
			cnt += 1
		else:
			ans += cnt - 1
			x = s[i]
			cnt = 1
	ans += cnt - 1
	print(ans)


def s():
	n = int(input())
	s = input()
	temp = ''
	ans = 0
	for x in s:
		if x == temp:
			ans += 1
		temp = x
	print(ans)
s()


n = int(input())
s = input()
cur = s[0]
d = 0
for c in range(1, n):
	if s[c] == cur:
		d += 1
	else:
		cur = s[c]
print(d)


N = int(input())
string = input()
string = list(string)
count = 0
while len(string) > 0:
	i = 0
	if i + 1 < len(string):
		if string[i] == string[i + 1]:
			count += 1
			string.pop(0)
		else:
			string.pop(0)
	else:
		break
print(count)


N = int(input())
Tx = input()
A = []
for i in range(0, len(Tx)):
	A += [Tx[i]]
V = 0
for i in range(0, len(A) - 1):
	if A[i] == A[i + 1]:
		V += 1
	else:
		V += 0
print(V)


n = int(input())
st = ['0'] + list(map(str, input())) + ['0']
i = 0
result = 0
for k in st[1:n + 1]:
	i += 1
	if k == st[i - 1] or k == st[i + 1]:
		st.pop(i)
		i -= 1
		result += 1
print(result)


from sys import stdin
n = int(stdin.readline())
rgb = stdin.readline()
summa = 0
for x in range(len(rgb) - 1):
	try:
		if rgb[x] == rgb[x + 1]:
			summa += 1
	except:
		continue
print(summa)


def main():
	n = input()
	clrs = input()
	ans = 0
	tmp = 0
	p_clr = ''
	for x in clrs:
		if x == p_clr:
			tmp += 1
		else:
			ans += max(0, tmp - 1)
			tmp = 1
		p_clr = x
	ans += max(0, tmp - 1)
	print(ans)
main()


n = int(input())
st = [i for i in input()]
cur = ''
c = 0
for i in range(n):
	if st[i] == cur:
		c += 1
	elif st[i] != cur:
		cur = st[i]
print(c)


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


n = int(input())
cveta = list(input())
n -= 1
res_1 = 0
i = 0
while i != n:
	if n > i:
		if cveta[i] == cveta[i + 1]:
			res_1 += 1
	if n == i:
		if cveta[i] == cveta[i - 1]:
			res_1 += 1
	i += 1
print(res_1)


integer = int
string = str
length = len

def main():
	n = integer(input())
	s = input()
	ans = 0
	for i in range(1, n):
		if s[i - 1] == s[i]:
			ans += 1
	print(ans)
main()


n = int(input())
s = str(input())
current = 'P'
result = 0
for i in s:
	if i != current:
		current = i
	else:
		result += 1
print(result)


count = int(input())
stones = input()
prev = stones[0]
res = 0
for i in stones[1:]:
	if i == prev:
		res += 1
	prev = i
print(res)


n = int(input())
arr = list(input())
x = 'a'
count = 0
for i in arr:
	if x == i:
		count += 1
	x = i
print(count)


n = int(input())
stones = list(input())
to_replace = 0
index = 1
while index < n:
	if stones[index] == stones[index - 1]:
		to_replace += 1
		stones.pop(index)
		n -= 1
	else:
		index += 1
print(to_replace)


n = int(input())
s = ['' for i in range(0, n)]
s_ = input()
count = 0
for i in range(0, n):
	s[i] = s_[i]
for i in range(0, n - 1):
	if s[i] == s[i + 1]:
		count += 1
		if i != n - 2:
			i += 1
print(count)


v = []
m = 0
x = int(input())
z = input()
for c in z:
	if c == 'R' or c == 'B' or c == 'G':
		v.append(c)
		if len(v) == x:
			for b in range(len(v) - 1):
				if v[0] == v[1]:
					m = m + 1
				v.remove(v[0])
			print(m)


Number = int(input())
Colors = input()
Count = 0
for i in range(0, len(Colors) - 1):
	if Colors[i] == Colors[i + 1]:
		Count = Count + 1
print(Count)


result = 0
num = int(input())
s = input()
if num > 0:
	let = s[0]
for i in range(1, num):
	if let != s[i]:
		let = s[i]
	else:
		result += 1
print(result)


from itertools import groupby
t = 0
c = 0
n = input()
s = input()
for (i, k) in groupby(s):
	g = len(list(k))
	if g > 1:
		t = 1
		c = c + g - 1
if t == 1:
	print(c)
else:
	print(0)


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


n = int(input())
s = input()
short = [s[0]]
for i in range(1, len(s)):
	if s[i] == s[i - 1]:
		continue
	short.append(s[i])
print(len(s) - len(short))


n = int(input())
m = input()
i = 0
c = 0
while i < len(m) - 1:
	if m[i] == m[i + 1]:
		while m[i] == m[i + 1]:
			i += 1
			c += 1
			if i == len(m) - 1:
				break
	else:
		i += 1
print(c)


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


import re
n = int(input())
seq = re.findall('\\w', input())
a = 0
run = True
i = 1
if n == 1:
	run = False
while run:
	if seq[i - 1] == seq[i]:
		del seq[i]
		a += 1
	else:
		i += 1
	if i >= len(seq):
		run = False
print(a)


n = int(input())
l = list(input())
ans = 0
for x in range(n - 1):
	if l[x] == l[x + 1]:
		ans = ans + 1
print(ans)


n = int(input())
s = str(input())
s2 = s
ncount = 0
for i in range(n - 1):
	if s[i] == s[i + 1]:
		s = s[:i] + ' ' + s[i + 1:]
		ncount += 1
s3 = s.replace(' ', '')
print(ncount)


val = int(input())
values = input()
count = 0
for i in range(val - 1):
	if values[i + 1] == values[i]:
		count = count + 1
print(count)


t = input()
s = input()
a = 'K'
k = 0
for c in s:
	if a == c:
		k += 1
	a = c
print(k)


stone_num = int(input())
stones = input()
removed = 0
color = stones[0]
for stone in range(1, stone_num):
	if stones[stone] == color:
		removed += 1
	elif color != stones[stone]:
		color = stones[stone]
print(removed)


length = int(input())
line = input()
enhancedLine = []
enhancedLine.append(line[0])
for i in range(1, len(line)):
	if enhancedLine[len(enhancedLine) - 1] != line[i]:
		enhancedLine.append(line[i])
print(len(line) - len(enhancedLine))


x = int(input())
y = input()
z = list(y)
a = 0
for i in range(1, x):
	if z[i] == z[i - 1]:
		a += 1
print(a)


n = int(input())
stones = list(input())
moves = 0
for i in range(n):
	if i + 1 == n:
		break
	elif stones[i] == stones[i + 1]:
		moves += 1
print(moves)


n = int(input())
pedras = input()
sub = [[]]
for pedra in pedras:
	if len(sub[-1]) == 0:
		sub[-1].append(pedra)
	elif sub[-1][0] == pedra:
		sub[-1].append(pedra)
	else:
		sub.append([pedra])
print(sum([len(i) - 1 for i in sub]))


num = int(input())
stones = list(input())
count = 0
last = stones[0]
for x in range(1, num):
	if last == stones[x]:
		count += 1
	else:
		last = stones[x]
print(count)


n = int(input())
s = input()
l = 1
x = 0
while l < len(s):
	if s[l] == s[l - 1]:
		x = x + 1
		s = s[:l] + s[l + 1:]
	else:
		l = l + 1
print(x)


length = int(input())
stones = input()
count = 0
erase = 0
for i in range(1, length):
	if stones[i] == stones[i - 1]:
		count += 1
	else:
		erase += count
		count = 0
erase += count
print(erase)


num = int(input())
a = list(input())
answer = []
for i in range(len(a)):
	if i == 0:
		answer.append(a[i])
	elif a[i] == answer[-1]:
		continue
	else:
		answer.append(a[i])
print(len(a) - len(answer))


length = int(input())
txt = str(input())
recent = txt[0]
count = 0
for i in range(1, len(txt)):
	if recent != txt[i]:
		recent = txt[i]
	else:
		count += 1
print(count)


n = int(input())
s = str(input())
c = 0
for i in range(n):
	if i > 0:
		if s[i] == s[i - 1]:
			continue
	for j in range(i + 1, n):
		if s[i] == s[j]:
			c += 1
		else:
			break
print(c)


n = int(input())
line = input()
x = 0
answer = 0
while x <= n - 2:
	if len(line) < x + 2:
		break
	elif line[x] == line[x + 1]:
		line = line[0:x] + line[x + 1:]
		x = 0
		answer += 1
	else:
		x += 1
print(answer)


n = int(input())
col = input()
count = 0
t = 0
rel = 'kdfh'
for i in col:
	if t == 0:
		rel = i
		t += 1
		continue
	if i == rel:
		count += 1
	else:
		rel = i
print(count)


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


input()
s = input()
tot = sum((s[i] == s[i - 1] for i in range(1, len(s))))
print(tot)


entrada = input()
entrada = input()
ultimo = entrada[0]
cuantos = 0
for x in entrada[1:]:
	if ultimo == x:
		cuantos += 1
	ultimo = x
print(cuantos)


p = int(input())
o = input()
while 'RR' in o:
	o = o.replace('RR', 'R')
while 'GG' in o:
	o = o.replace('GG', 'G')
while 'BB' in o:
	o = o.replace('BB', 'B')
print(p - len(o))


n = int(input())
s = input()
count = 0
side = 0
for i in range(0, len(s) - 1):
	sss = s[side:i + 2]
	side = side + 1
	if sss[0] == sss[1]:
		count = count + 1
print(count)


n = input()
s = input()
counter = 0
for i in range(len(s) - 1):
	if s[i] == 'R' and s[i + 1] == 'R':
		counter += 1
	elif s[i] == 'G' and s[i + 1] == 'G':
		counter += 1
	elif s[i] == 'B' and s[i + 1] == 'B':
		counter += 1
print(counter)


import sys

def solver(bubba):
	ans = 0
	prev = 'y'
	for x in bubba:
		if x == prev:
			ans = ans + 1
		prev = x
	return ans

def main():
	lines = sys.stdin.readlines()
	print(solver(lines[1]))
main()


n = int(input())
s = input()
li = list(s)
count = 0
for j in range(1, len(li)):
	if li[j - 1] == li[j]:
		count += 1
print(count)


n = int(input())
s = input()
l = list(s)
count = 0
for i in range(0, n):
	try:
		if l[i] == l[i + 1]:
			l[i] = '.'
			count += 1
	except:
		pass
print(count)


n = input()
str = input()
cnt = 0
for x in range(1, len(str)):
	if str[x - 1] == str[x]:
		cnt += 1
print(cnt)


n = int(input())
st = input()
i = 1
lst = st[0]
t = 1
ans = 0
while i < len(st):
	if st[i] == lst:
		t += 1
	else:
		lst = st[i]
		ans += t - 1
		t = 1
	i += 1
ans += int(t - 1)
print(ans)


n = int(input())
m = input()
c = 0
try:
	for i in range(n):
		if m[i] == m[i + 1]:
			c = c + 1
except Exception as e:
	print(end='')
print(c)


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


n = int(input())
s = input()
ls = []
for x in s:
	if ls == [] or ls[-1] != x:
		ls.append(x)
print(len(s) - len(ls))


useless = input()
a = input()
result = 0
for i in range(len(a)):
	if i:
		if a[i] == a[i - 1]:
			result += 1
print(result)


n = int(input())
s = input()
p = 'H'
f = 0
for c in s:
	if c == p:
		f += 1
	else:
		p = c
print(f)


n = int(input())
a = list(input())
test = a[0]
sum1 = 0
for i in range(1, n):
	if a[i] == test:
		sum1 += 1
	else:
		test = a[i]
print(sum1)


def stone(quantity, string):
	count = ''
	s = ''
	if len(string) <= int(quantity):
		for i in string:
			if s == i:
				count += i
			else:
				s = i
	return len(count)
res = stone(input(), input())
print(res)


def main1(a, n):
	c = 0
	for i in range(len(a) - 1):
		if a[i] == a[i + 1]:
			c += 1
	print(c)
n = input()
a = str(input())
main1(a, n)


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


no_of_stones = int(input())
colour_of_the_stones = input()
picked_stones = 0
stone = colour_of_the_stones[0]
for colour in colour_of_the_stones[1:]:
	if colour == stone:
		picked_stones += 1
	else:
		stone = colour
print(picked_stones)


n = int(input())
s = input()
c = 0
last = s[0]
t = 0
i = 0
while i < n - 1:
	c = 0
	while i < n - 1 and s[i] == s[i + 1]:
		c += 1
		i += 1
	t += c
	if c == 0:
		i += 1
print(t)


n = int(input())
s = input().strip()
st = [-1]
count = 0
for i in s:
	if st[-1] != i:
		st.append(i)
	else:
		count += 1
print(count)


def main():
	n = int(input())
	stones = input()
	out = 0
	for i in range(n - 1):
		if stones[i] == stones[i + 1]:
			out += 1
	print(out)
main()


i = input()
stones = input()
count = 0
while True:
	if 'RR' in stones:
		stones = stones.replace('RR', 'R', 1)
		count += 1
	elif 'GG' in stones:
		stones = stones.replace('GG', 'G', 1)
		count += 1
	elif 'BB' in stones:
		stones = stones.replace('BB', 'B', 1)
		count += 1
	else:
		break
print(count)


n = int(input())
d = input()
c = 0
for x in range(n - 1):
	if d[x] != d[x + 1]:
		continue
	else:
		c += 1
print(c)


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


import re
print(int(input()) - len(re.sub('(.)\\1*', '\\1', input())))


masukan1 = int(input())
masukan2 = input()
x = 0
for i in range(1, len(masukan2)):
	if masukan2[i - 1] == masukan2[i]:
		x = x + 1
print(x)


import sys
n = sys.stdin.readline()
stones = sys.stdin.readline().strip()
c = 0
for s in range(1, len(stones)):
	if stones[s] == stones[s - 1]:
		c += 1
sys.stdout.write(str(c) + '\n')


n = int(input())
st = input()
g = len(st)
while st.count('RR') != 0 or st.count('GG') != 0 or st.count('BB') != 0:
	st = st.replace('RR', 'R')
	st = st.replace('GG', 'G')
	st = st.replace('BB', 'B')
print(g - len(st))


n = int(input())
w = input()
count = 0
i = 0
while i < n - 1:
	if w[i] == w[i + 1]:
		for j in range(i + 1, n):
			if w[i] == w[j]:
				count = count + 1
				i = i + 1
			else:
				break
	else:
		i = i + 1
print(count)


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


input()
s = input()
answer = 0
for i in range(1, len(s)):
	if s[i] == s[i - 1]:
		answer += 1
print(answer)


n = int(input())
arr = list(input())
e = 0
p = ''
r = 0
for i in range(0, n):
	if e == 0:
		p = arr[i]
		e = 1
		continue
	if p == arr[i]:
		r += 1
		p = arr[i]
	else:
		p = arr[i]
		continue
print(r)


n = int(input())
colors = input()
last = colors[0]
number_remove = 0
for i in range(1, n):
	if colors[i] == last:
		number_remove += 1
		continue
	else:
		last = colors[i]
print(number_remove)


b = input()
a = list(input())
k = 0
for i in range(len(a) - 1):
	if a[i] == a[i + 1]:
		k += 1
print(k)


n = int(input())
x = input()
tot = 0
idx = 0
while idx < len(x):
	cur = x[idx]
	cnt = 0
	while idx < len(x) and x[idx] == cur:
		cnt += 1
		idx += 1
	tot += cnt - 1
print(tot)


n = int(input())
x = input()
stones = []
a = 0
b = 0
for i in x:
	stones.append(i)
for i in range(n):
	if len(stones) == a + 1 or len(stones) == 1:
		break
	elif stones[a] == stones[a + 1]:
		del stones[a + 1]
		b += 1
	elif stones[a] != stones[a + 1]:
		a += 1
print(b)


n = int(input())
s = input()
res = 0
pred = ''
for c in s:
	if c == pred:
		res += 1
	pred = c
print(res)


n = int(input())
s = str(input())
length = len(s)
ans = 0
prev = s[0]
for i in range(1, length):
	if s[i] == prev:
		ans = ans + 1
	else:
		prev = s[i]
print(ans)


n = int(input().strip())
our_string = list(input().strip())
count = 0
for i in range(1, n):
	if our_string[i - 1] == our_string[i]:
		count += 1
print(count)


n = int(input())
stones = list(input())
ans = 0
prev = stones[0]
for stoneIndex in range(1, n):
	if stones[stoneIndex] == prev:
		stones[stoneIndex] = 'x'
	else:
		prev = stones[stoneIndex]
for stoneIndex in range(n):
	if stones[stoneIndex] == 'x':
		ans += 1
print(ans)


import sys
import math
import collections
from collections import deque
from functools import reduce
from sys import stdin, stdout, setrecursionlimit
setrecursionlimit(2 ** 20)

def factors(n):
	return list(set(reduce(list.__add__, ([i, n // i] for i in range(1, int(n ** 0.5) + 1) if n % i == 0))))
n = int(stdin.readline())
s = list(str(stdin.readline().strip('\n')))
c = 0
for i in range(n - 1):
	if s[i] == s[i + 1]:
		c += 1
print(c)


n = int(input())
s = input()
tot = 0
i = 0
while i < n:
	st = s[i]
	j = i
	cnt = 0
	while j < n and s[j] == st:
		cnt += 1
		j += 1
	i = max(i + 1, j)
	if cnt > 1:
		tot += cnt - 1
print(tot)


number = input()
stone1 = input()
length = len(stone1)
delete = 0
for i in range(length - 1):
	if stone1[i] == stone1[i + 1]:
		delete += 1
print(delete)


n = input()
m = input()
M = list(m)
count = 0
x = ' '
for i in M:
	if i == x:
		count = count + 1
	x = i
print(count)


n = int(input())
s = input()
a = []
for i in range(len(s)):
	a.append(s[i])
s = 0
for i in range(len(a)):
	for j in range(1, len(a) - 1):
		if a[j - 1] == a[j] or a[j + 1] == a[j]:
			del a[j]
			s += 1
			break
if len(a) == 2:
	if a[0] == a[1]:
		s += 1
print(s)


n = int(input())
word = input()
num = 0
for i in range(n):
	if i > 0 and word[i] == word[i - 1]:
		num = num + 1
print(num)


t = int(input())
x = input()
o = 0
for i in range(0, t):
	if i < t - 1 and x[i] == x[i + 1]:
		o = o + 1
print(o)


def main():
	input()
	line = input()
	ans = 0
	cur = line[0]
	for c in line[1:]:
		if c == cur:
			ans += 1
		else:
			cur = c
	print(ans)
main()


T = int(input())
string = input()
count = 0
for i in range(len(string) - 1):
	if string[i] != string[i + 1]:
		count = count
	else:
		count += 1
print(count)


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


number = int(input())
stones = str(input())
match = 0
for i in range(number - 1):
	if stones[i] == stones[i + 1]:
		match += 1
print(match)


n = int(input())
stones = list(input())
count = 0
for i in range(n - 1):
	try:
		if stones[i] == stones[i + 1]:
			count += 1
	except:
		pass
print(count)


numOfStone = int(input())
stonesStr = input()
numOfRemovedStone = 0
for i in range(1, numOfStone):
	if stonesStr[i] == stonesStr[i - 1]:
		numOfRemovedStone += 1
print(numOfRemovedStone)


n = int(input())
s = input()
z = s[0]
c = 0
if n >= 1 and n <= 50:
	for i in range(1, n):
		if z == s[i]:
			c += 1
		z = s[i]
	print(c)


temp = input()
c = int(0)
s = str('m')
a = str(input())
for i in range(0, len(a)):
	b = a[i]
	if b == s:
		c += 1
	else:
		s = a[i]
print(int(c))


n = int(input())
count = 0
st = input()
check = st[0]
for i in range(1, n):
	if st[i] is check:
		count += 1
	else:
		count = count
	check = st[i]
print(count)


t = input()
s = [x for x in input()]
ind = 0
ans = 0
for i in s:
	try:
		if i == s[ind + 1]:
			ans += 1
	except:
		pass
	ind += 1
print(ans)


num = int(input())
n = str(input())
string = str()
i = 0
unswer = 0
a = len(n)
while i < len(n) - 1:
	if n[i] == n[i + 1]:
		i += 1
		unswer += 1
	else:
		string = string + str(n[i])
		i += 1
if n[a - 1] == n[a - 2]:
	string = string + str(n[a - 1])
print(unswer)


t = int(input())
a = list(map(str, input().strip()))
count = 0
z = a[0]
for i in range(1, len(a)):
	if z == a[i]:
		count += 1
	z = a[i]
print(count)


import re
n = int(input())
string = input()
pattern = re.compile('(R{2,}|B{2,}|G{2,})')
sum = 0
for i in pattern.findall(string):
	sum += len(i) - 1
print(sum)


n = input()
line = input()
pairs = ['RR', 'GG', 'BB']
count = 0
for i in range(len(line)):
	if line[i:i + 2] in pairs:
		count += 1
print(count)


import sys
(L, str) = sys.stdin.read().split()
L = int(L)
current = str[0]
result = 0
for i in range(1, L, 1):
	next = str[i]
	result += 1 if current == next else 0
	current = next
print(result)


n = int(input())
stones = input()
neg = 1
for stone in range(n - 1):
	if stones[stone] == stones[stone + 1]:
		neg += 1
print(neg - 1)


n = int(input())
L = list(input())
K = [L[0]]
for i in range(1, n):
	if K[-1] != L[i]:
		K.append(L[i])
print(n - len(K))


n = int(input())
l = list(input())
p = l[0]
ans = 0
for i in range(1, n):
	if l[i] == p:
		ans += 1
	else:
		p = l[i]
print(ans)


n = int(input())
col = input()
count1 = 0
for i in range(0, n - 1):
	if col[i] == col[i + 1]:
		count1 = count1 + 1
	else:
		pass
print(count1)


input()
c = ''
n = 0
for let in input():
	if let == c:
		n += 1
	else:
		c = let
print(n)


n = int(input())
line = [ch for ch in input()]
idx = 0
cnt = 0
while idx < len(line) and idx + 1 < len(line):
	if line[idx] == line[idx + 1]:
		cnt += 1
	idx += 1
print(cnt)


x = int(input())
word2 = input()
word = list()
for el in word2:
	word.append(el)
op = 0

def modifyListe(liste):
	global op
	for i in range(len(liste)):
		if i + 1 < len(liste):
			ilkharf = liste[i]
			sonharf = liste[i + 1]
			if ilkharf == sonharf:
				liste.pop(i)
				op += 1
				modifyListe(liste)
modifyListe(word)
print(op)


(b, a, i, c) = (int(input()), str(input()), 1, 0)
while i < b:
	if a[i] == a[i - 1]:
		c += 1
	i += 1
print(c)


trash = int(input())
s = input()
last = 'Z'
i = 0
res = 0
while i < trash:
	if s[i] == last:
		res += 1
	last = s[i]
	i += 1
print(res)


n = int(input())
stones = list(input())
taken = 0
for i in range(0, len(stones) - 1):
	cur = stones[i]
	next = stones[i + 1]
	if cur == next:
		taken += 1
print(taken)


def getline(tcast):
	return [tcast(x) for x in input().strip().split(' ')]

def getvar(tcast):
	return tcast(input().strip())
n = getvar(int)
s = getvar(str)
difs = 1
for (i, c) in enumerate(s[1:]):
	if c != s[i]:
		difs += 1
print(n - difs)


n = int(input())
string = input()
removeCount = 0
for index in range(n):
	if index + 1 < n:
		if string[index] == string[index + 1]:
			removeCount += 1
print(removeCount)


n = int(input())
stone = input()
a = stone[0]
num = 0
for i in range(1, n):
	if stone[i] == a:
		num += 1
	else:
		a = stone[i]
print(num)


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 = input()
a = list(input())
s = [a[0]]
c = 0
for i in range(1, len(a)):
	if a[i] != s[-1]:
		s.append(a[i])
	else:
		c = c + 1
print(c)


import re
s = input()
s = input()
l = 0
a = 0
for i in range(len(s)):
	if i == 0 or s[i - 1] != s[i]:
		a += l
		l = 0
	else:
		l += 1
print(a + l)


n = int(input())
c = input()
k = 1
r = 0
for i in c:
	if k <= len(c) - 1:
		if i == c[k]:
			r = r + 1
	k = k + 1
print(r)


n = int(input())
s = input()

def fun(s, n):
	count = 0
	flag = 0
	s1 = ''
	if n == 1:
		return 0
	for i in range(n - 1):
		if s[i] == s[i + 1]:
			count += 1
			flag = 1
		else:
			s1 = s1 + s[i]
	s1 = s1 + s[i + 1]
	if flag == 1:
		count = count + fun(s1, len(s1))
	return count
print(fun(s, n))


number = int(input())
color = input()
times = 0
old = color[0]
for i in range(1, number):
	if color[i] == old:
		times += 1
	else:
		old = color[i]
print(times)


n = int(input())
array = list(input())
delete = []
for i in range(n - 1):
	if i not in delete and array[i] == array[i + 1]:
		delete.append(i)
print(len(delete))


import sys
input()
s = sys.stdin.readline().strip()
nb = 0
for i in range(len(s) - 1):
	if s[i] == s[i + 1]:
		nb += 1
print(nb)


k = int(input())
l = input()
ct = 0
lc = ''
for i in l:
	if lc == i:
		ct = ct + 1
	else:
		lc = i
print(ct)


n = int(input())
L = input()
cnt = 0
i = 0
while i < n:
	j = i
	while j < n and L[i] == L[j]:
		j += 1
	cnt += j - i - 1
	i = j
print(cnt)


numOfStones = int(input())
colors = input()
count = 0
for x in range(1, numOfStones):
	if colors[x - 1] == colors[x]:
		count += 1
print(count)


__author__ = 'Utena'

def alt(a):
	b = ''
	b += a[0]
	for i in a[1:len(a)]:
		if i != b[-1]:
			b += i
	return b
n = input()
s = input()
print(len(s) - len(alt(s)))


number = int(input())
str = input()
cnt = 0
for i in range(number - 1):
	if str[i] == str[i + 1]:
		cnt += 1
print(cnt)


n = int(input())
a = input()
i = 0
changes = 0
while i < n:
	j = i + 1
	while j < n and a[j] == a[i]:
		changes += 1
		j += 1
	i = j
print(changes)


n = int(input())
a = str(input())
m = str()
k = 0
for i in range(n):
	if str(a[i]) == 'R':
		m = m + '1'
	elif a[i] == 'G':
		m = m + '2'
	elif a[i] == 'B':
		m = m + '3'
m = '0' + m
for i in range(1, len(m)):
	if int(m[i]) == int(m[i - 1]):
		k = k + 1
print(k)


n = int(input())
string = str(input())
count = 0
l = ['RR', 'GG', 'BB']
l2 = ['R', 'G', 'B']
for (colors, color) in zip(l, l2):
	while string.count(colors) >= 1:
		string = string.replace(colors, color, 1)
		count = count + 1
print(count)


count = 0
i = 0
n = int(input())
stones = input()
stone = list(stones)
while i < n - 1:
	if stone[i] == stone[i + 1]:
		count = count + 1
		i = i + 1
	else:
		i = i + 1
print(count)


rocks_num = int(input())
rocks = input()
removed_rocks = 0
for x in range(0, rocks_num - 1):
	while rocks[x] == rocks[x + 1]:
		removed_rocks += 1
		break
print(removed_rocks)


input()
b = input()
f = 0
for i in range(len(b) - 1):
	if b[i] == b[i + 1]:
		f += 1
print(f)


a = input('')
b = input('')
answer = 0
for num in range(len(b)):
	if num + 1 < len(b):
		if b[num] == b[num + 1]:
			answer = answer + 1
print(answer)


x = int(input())
y = input()
z = 0
a = []
for i in range(len(y) - 1):
	if y[i] == y[i + 1]:
		z += 1
		a.append(y[i])
print(z)


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


n = eval(input())
s = input()
lastChr = s[0]
count = 0
for c in s[1:]:
	if c == lastChr:
		count += 1
	lastChr = c
print(count)


def stones(letters):
	count = 0
	prev = ''
	for letter in letters:
		if letter == prev:
			count += 1
		prev = letter
	return count
n = input()
letters = input()
print(stones(letters))


n = int(input())
stones = input()
count = 0
result = [stones[0]]
for i in range(1, n):
	if result[-1] == stones[i]:
		count += 1
	result.append(stones[i])
print(count)


n = int(input())
stones = input()
curr = stones[0]
rep = 0
total = 0
for pos in range(1, n):
	if stones[pos] == curr:
		rep += 1
		total += 1
	else:
		rep = 0
		curr = stones[pos]
print(total)


n = int(input())
count = 0
str = input()
max = 0
for i in range(1, n):
	if str[i] == str[i - 1] and str[i] == 'B':
		count += 1
		max = count
	elif str[i] == str[i - 1] and str[i] == 'G':
		count += 1
		max = count
	elif str[i] == str[i - 1] and str[i] == 'R':
		count += 1
		max = count
print(max)


n = input()
row = input()
prev = 0
count = 0
for i in range(int(n)):
	if row[i] == prev:
		count += 1
	prev = row[i]
print(count)


n = input()
s = str(input())
total = 0
for (x, y) in zip(s, s[1:]):
	if x == y:
		total += 1
print(total)


a = int(input())
b = []
x = input()
for i in range(a):
	if x[i] == 'R':
		b.append(0)
	elif x[i] == 'G':
		b.append(1)
	else:
		b.append(2)
count = 0
for j in range(0, len(b) - 1):
	if b[j] == b[j + 1]:
		count += 1
print(count)


n = int(input())
s = input()
count = 0
old = 't'
for i in s:
	if not i == old:
		count += 1
		old = i
print(len(s) - count)


n = int(input())
stone = input()
count = 0
for x in range(0, len(stone) - 1):
	if stone[x] == stone[x + 1]:
		count += 1
print(count)


def solve():
	n_rocks = int(input())
	colors = list(input())
	remove = 0
	cur_color = colors[0]
	for color in colors[1:]:
		if cur_color == color:
			remove += 1
		else:
			cur_color = color
	print(remove)
solve()


stones = int(input())
i = 0
cantidad = 0
entrada = input()
while i < len(entrada):
	if i < len(entrada) - 1:
		if entrada[i] == entrada[i + 1]:
			cantidad += 1
	i += 1
print(cantidad)


a = input()
a = input()
m = 0
for i in range(len(a) - 1):
	if a[i] == a[i + 1]:
		m += 1
print(m)


num = int(input())
inp = input()
cnt = 0
for i in range(1, len(inp)):
	if inp[i - 1] == inp[i]:
		cnt = cnt + 1
print(cnt)


def min_number_stones(rsize, stones):
	taken_stones = 0
	for i in range(rsize - 1):
		if stones[i] == stones[i + 1]:
			taken_stones += 1
	return taken_stones
n = int(input())
s = input()
print(min_number_stones(n, s))


n = int(input())
stones = list(input())
counter = 0
for i in range(n - 1):
	if stones[i] != stones[i + 1]:
		continue
	else:
		counter += 1
print(counter)


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


a = input()
b = input()
counter = 0
j = 0
while j < len(b) - 1:
	if b[j] == b[j + 1]:
		counter += 1
	j += 1
print(counter)


from itertools import groupby

def main():
	n = int(input())
	string = input()
	if len(set(string)) == 1:
		return n - 1
	else:
		return sum((len(list(x[1])) - 1 for x in groupby(string)))
print(main())


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


def CantidadAgarradas(Colores):
	if len(Colores) < 2:
		return 0
	else:
		Contador = 0
		ListaColores = list(Colores)
		Anterior = ListaColores[0]
		for k in range(1, len(ListaColores)):
			if ListaColores[k] == Anterior:
				Contador += 1
			else:
				Anterior = ListaColores[k]
		return Contador
N = input()
Colores = input()
print(CantidadAgarradas(Colores))


n = int(input())
word = input()
word = list(word)
m = len(word)
word.append(0)
i = 0
while word[i] != 0:
	if word[i] == word[i + 1]:
		word.pop(i + 1)
		i = i - 1
	i = i + 1
k = len(word)
print(m - k + 1)


num = int(input())
stones = list(input())
count = 0
i = 0
while i < num - 1:
	if stones[i] == stones[i + 1]:
		count += 1
	i += 1
print(count)


num_stones = int(input())
colors = input()
num_remove = 0
for i in range(num_stones - 1):
	if colors[i] == colors[i + 1]:
		num_remove += 1
print(num_remove)


time = int(input())
stones = input()
count = 0
for num in range(1, time):
	if stones[num] == stones[num - 1]:
		count += 1
print(count)


numbers_of_color = int(input())
x = input()
numbers = 0
for j in range(numbers_of_color - 1):
	if x[j] == x[j + 1]:
		numbers = numbers + 1
print(numbers)


n = int(input())
word = input()
color = {'RR', 'GG', 'BB'}
count = 0
for i in range(n):
	if word[i:i + 2] in color:
		count += 1
print(count)


n = int(input())
line = input()
num = 0
i = 1
a = line[0]
while i < n:
	if a == line[i]:
		num += 1
	else:
		a = line[i]
	i += 1
print(num)


count = 0
s = int(input())
u = list(input())
for j in range(len(u) - 1):
	if u[j] == u[j + 1]:
		count += 1
print(count)


n = int(input().strip())
table = list(input().strip())
remove = 0
for (i, stone) in enumerate(table[:-1]):
	if stone == table[i + 1]:
		remove += 1
print(remove)


n = int(input())
s = input()
li = list(s)
length = len(li)
rem = 0
i = 0
rem = 0
for i in range(0, length - 1):
	if li[i] == li[i + 1]:
		rem += 1
print(rem)


length = int(input())
string = list(input())
count = 0
for i in range(1, length):
	if string[i] == string[i - 1]:
		count += 1
print(count)


n = int(input())
l = input()
if len(l) == n:
	L = list(l)
else:
	exit(1)
j = 0
for i in range(n - 1):
	if L[i] == L[i + 1]:
		j += 1
print(j)


(curr, ans, nexte) = (0, 0, 1)
n = int(input())
s = input()
while nexte < len(s):
	if s[curr] == s[nexte]:
		ans += 1
		nexte += 1
	else:
		curr = nexte
		nexte += 1
print(ans)


a = input
a()
b = a()
print(sum((i == j for (i, j) in zip(b[1:], b))))


length = int(input())
row = input()
removed = 0
previous = row[0]
for i in range(1, length):
	if str(row[i]) == previous:
		removed += 1
	previous = row[i]
print(removed)


n = input()
stri = input()
count = 0
r = 1
l = 0
while r < len(stri):
	if stri[r] == stri[l]:
		count += 1
	l += 1
	r += 1
print(count)


n = int(input())
stones = input()
print(sum([1 for i in range(n - 1) if stones[i] == stones[i + 1]]))


n = int(input())
s = input()
count = 0
if n >= 1 and n <= 50:
	for i in range(n - 1):
		if s[i] == s[i + 1]:
			s.replace(s[i], '')
			count += 1
print(count)


def main():
	from sys import stdin, stdout
	n = int(stdin.readline())
	count = 0
	s = stdin.readline().strip()
	for i in range(1, n):
		if s[i] == s[i - 1]:
			count += 1
	stdout.write(str(count))
main()


x = int(input())
y = x - 1
string = input()
string = list(string)
while y != 0:
	if string[y] == string[y - 1]:
		string.pop(y)
	y = y - 1
print(x - len(string))


nStr = input()
n = int(nStr)
stoneList = input()
index = 1
removeStone = 0
curStone = stoneList[0]
while index < len(stoneList):
	if stoneList[index] != curStone:
		curStone = stoneList[index]
		index = index + 1
	else:
		stoneList = stoneList[0:index] + stoneList[index + 1:]
		removeStone = removeStone + 1
print(removeStone)


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


z = int(input())
x = input()
j = 0
for i in range(z - 1):
	if list(x)[i] == list(x)[i + 1]:
		j += 1
print(j)


(u, a) = (int(input()), input())
ans = 0
for m in range(1, len(a)):
	if a[m - 1] == a[m]:
		ans += 1
print(ans)


def valid(s):
	for i in range(len(s) - 1):
		if s[i] == s[i + 1]:
			return False
	return True
n = int(input())
s = input().strip()
c = 0
while not valid(s):
	x = ''
	i = 0
	while i < len(s) - 1:
		x += str(s[i])
		if s[i] == s[i + 1]:
			i += 2
			c += 1
		else:
			i += 1
	if i == len(s) - 1:
		x += str(s[i])
	s = x
print(c)


from itertools import groupby
n = int(input())
s = input()
ans = 0
for (k, grp) in groupby(s):
	x = len(list(grp))
	ans += x - 1 if x > 1 else 0
print(ans)


stoneCount = input()
stones = input()
count = 0
i = 0
while i < len(stones):
	if i + 1 < len(stones) and stones[i] == stones[i + 1]:
		stones = stones[0:i] + stones[i + 1:len(stones)]
		i -= 1
		count += 1
	i += 1
print(count)


n = int(input())
a = input()
cnt = 0
did = 0
for i in range(n - 1):
	if a[i] == a[i + 1]:
		cnt += 1
print(cnt)


counter = 0
global_counter = 0
max_val = 1
colour = 'none'
n = input()
s = input()
s = list(s)
for i in range(len(s)):
	if s[i] == colour:
		counter += 1
		global_counter += 1
	else:
		colour = s[i]
		counter = 1
print(global_counter)


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


x = int(input())
_str = input()
counter = 0
for i in range(len(_str)):
	if i != len(_str) - 1 and _str.__getitem__(i) == _str.__getitem__(i + 1):
		counter += 1
print(counter)


from sys import stdin, exit
stdin.readline()
s = list(stdin.readline().rstrip())
l = len(s)
inv = 0
for i in range(1, l):
	if s[i - 1] == s[i]:
		inv += 1
		if s[i - 1] == 'G':
			s[i - 1] = 'R'
		elif s[i - 1] == 'R':
			s[i - 1] = 'G'
		else:
			s[i - 1] = 'B'
print(inv)


import math
import os
import random
import re
import sys
a = input()
s = str(input())
i = 0
t = s
count = 0
while i < len(s) - 1:
	if s[i] == s[i + 1]:
		s = s.replace('s[i]', '')
		count = count + 1
	i = i + 1
print(count)


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


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


def solve():
	n = int(input())
	s = input()
	stones = 0
	for i in enumerate(s[:n - 1]):
		if s[i[0]] == s[i[0] + 1]:
			stones += 1
	print(stones)
solve()


n = int(input())
e = 0
order = input()
for x in range(n - 1):
	if order[x] == order[x + 1]:
		e += 1
print(e)


n = int(input())
(c, h) = (-1, '')
for i in input():
	if h != i:
		c += 1
		h = i
print(n - c - 1)


n = int(input())
s = str(input())
st = []
ans = 0
top = -1
for i in range(n):
	if top == -1:
		st.append(s[i])
		top += 1
	elif s[i] == st[top]:
		ans += 1
	else:
		st.append(s[i])
		top += 1
print(ans)


input()
string = input()
string += 'p'
ans = 0
for f in range(len(string) - 1):
	if string[f] == string[f + 1]:
		ans += 1
print(ans)


num_stones = int(input())
stones = list(input())
num_stones_to_remove = 0
idx_i = 0
idx_j = 1
while idx_j < num_stones:
	if stones[idx_i] == stones[idx_j]:
		num_stones_to_remove += 1
	idx_i += 1
	idx_j += 1
print(num_stones_to_remove)


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


x = int(input())
l = list(input())
(c, i, s) = (1, 0, 0)
x1 = [l[0]]
for i in range(len(l)):
	if l[i] != x1[-1]:
		x1.append(l[i])
print(len(l) - len(x1))


n = int(input())
leitura = input()
x = 0
res = 0
while x < n - 1:
	if leitura[x] == leitura[x + 1]:
		res = res + 1
		pass
	x = x + 1
	pass
print(res)


n = input()
I1 = input()
I2 = []
if len(I1) == 1:
	print(0)
else:
	for i in range(len(I1)):
		if i == 0:
			I2.append(I1[0])
		elif I1[i] == I1[i - 1]:
			i += 1
		else:
			I2.append(I1[i])
			i += 1
	I3 = ''.join(I2)
	print(len(I1) - len(I3))


int(input())
S = input()
print(sum((S[n] == S[n + 1] for n in range(len(S) - 1))))


n = int(input())
s = input()
a = []
for i in s:
	a.append(i)
i = 0
while i < n - 1:
	if a[i] == a[i + 1]:
		del a[i + 1]
		n = n - 1
	else:
		i = i + 1
print(len(s) - len(a))


n = int(input())
s = input()
length = len(s)
count = 0
for i in range(length - 1):
	part = s[i:i + 2]
	if len(set(part)) == 1:
		count += 1
print(count)


n = int(input())
st = input()
lt = []
for i in range(1, n):
	if st[i] == st[i - 1]:
		lt.append(st[i])
print(len(lt))


_ = input()
stones = input()
last_st = ''
neighbours = 0
for s in stones:
	if s == last_st:
		neighbours += 1
	last_st = s
print(neighbours)


l = []
for i in range(2):
	e = input()
	l.append(e)
x = l[1]
y = [0]
x = list(x)
for i in x:
	if i != y[-1]:
		y.append(i)
	else:
		continue
removes = len(x) - (len(y) - 1)
print(removes)


n = int(input())
s = input()
(start, prev) = (1, s[0])
c = 0
while start < n:
	if s[start] == prev:
		c += 1
	else:
		prev = s[start]
	start += 1
print(c)


n = int(input())
st = str(input())
p = []
cont = 0

def isok(ls):
	for i in range(len(ls) - 1):
		if ls[i] == ls[i + 1]:
			ls.pop(i + 1)
			return False
	return True
for i in st:
	p.append(i)
while not isok(p):
	cont += 1
print(cont)


n = int(input())
line = input().rstrip()
count_1 = 0
count_2 = 0
count_3 = 0
total_count = 0
if 'RR' in line or 'GG' in line or 'BB' in line:
	for i in line:
		if i == 'R':
			count_1 += 1
			count_2 = 0
			count_3 = 0
			if count_1 >= 2:
				total_count += 1
		elif i == 'G':
			count_2 += 1
			count_1 = 0
			count_3 = 0
			if count_2 >= 2:
				total_count += 1
		else:
			count_3 += 1
			count_1 = 0
			count_2 = 0
			if count_3 >= 2:
				total_count += 1
else:
	total_count = 0
print(total_count)


n = int(input())
k = list(input())
ans = [0]

def kamni(c):
	try:
		a = k[c]
		b = k[c + 1]
		if a == b:
			del k[c + 1]
			kamni(c)
	except:
		ans.append(n - len(k))
for i in range(n - 1):
	kamni(i)
set(ans)
if len(ans) > 1:
	print(ans[1])
else:
	print(ans[0])


quantity = int(input())
colors = input()
last = 'q'
counter = 0
for i in range(len(colors)):
	if colors[i] == last:
		counter += 1
	else:
		last = colors[i]
print(counter)


import re

def main():
	size = int(input())
	s = input()
	res = 0
	if size > 1:
		for i in range(size - 1):
			if s[i] == s[i + 1]:
				res += 1
				i += 1
	print(res)
main()


n = int(input().strip())
input_str = input().strip()
last = input_str[0]
count = 0
for i in input_str[1:]:
	if i == last:
		count += 1
	last = i
print(count)


tam = int(input())
string = input()
changes = 0
i = 1
while i < tam:
	if string[i - 1] == string[i]:
		changes += 1
		string = string[:i] + string[i + 1:]
		tam -= 1
	else:
		i += 1
print(changes)


number = int(input())
g = list(input())
temp = 0
for i in range(number):
	if i > 0:
		if g[i - 1] == g[i]:
			temp += 1
print(temp)


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


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


def change(s, n):
	if n == 1:
		return 0
	ls = list(s)
	for i in range(n - 1):
		if ls[i] == ls[i + 1]:
			del ls[i]
			return 1 + change(''.join(ls), n - 1)
	return 0
n = int(input())
s = input()
print(change(s, n))


from itertools import groupby
input()
print(sum([abs(1 - len(tuple(item[1]))) for item in groupby(input())]))


num_piedras = input()
color_piedras = input()
numero_final = 0
for i in range(1, len(color_piedras)):
	if color_piedras[i - 1] == color_piedras[i]:
		numero_final += 1
print(numero_final)


(n, seq) = (int(input()), list(input()))
tseq = zip(seq, seq[1:])
c = 0
for a in tseq:
	if a[0] == a[1]:
		c += 1
print(c)


input()
f = input()
print(sum((x == y for (x, y) in zip(f, f[1:]))))


n = int(input())
stones = list(input())
temp = 'A'
count = 0
for x in stones:
	if x == temp:
		count += 1
	temp = x
print(count)


n = input()
ch = input()
count = 0
temp = 0
a = ch[0]
for i in range(1, int(n)):
	b = ch[i]
	if b == a:
		temp += 1
	else:
		count += temp
		temp = 0
	a = b
count += temp
print(count)


input()
str = input()
a = []
ans = 0
for i in range(len(str)):
	a.append(str[i])
	if a[i] == a[i - 1] and i != 0:
		ans = ans + 1
print(ans)


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


n = int(input())
x = input().lower()
sum = 0
for i in range(len(x) - 1):
	if x[i] == x[i + 1]:
		sum += 1
print(sum)


n = int(input())
b = input()
c = [b[0]]
for i in range(1, len(b)):
	if b[i] != b[i - 1]:
		c.append(b[i])
print(len(b) - len(c))


n = int(input())
l = input()
cur = l[0]
c = 0
for i in range(1, n):
	if l[i] == cur:
		c += 1
	else:
		cur = l[i]
print(c)


x = int(input())
p = input()
count = 0
for i in range(x - 1):
	if p[i] == p[i + 1]:
		count += 1
print(count)


n = int(input())
letters = str(input())
last = letters[0]
sum = 0
for i in range(n - 1):
	if letters[i + 1] == last:
		sum += 1
	else:
		last = letters[i + 1]
print(sum)


a = int(input())
array = list(input())
j = 0
for i in range(a - 1):
	if array[i] == array[i + 1]:
		j = j + 1
print(j)


def find(s):
	c = 0
	for i in range(1, len(s)):
		if s[i] == s[i - 1]:
			c = c + 1
	print(c)
x = int(input())
s = input()
find(s)


(n, s, l) = (int(input()), input().strip(), None)
c = 0
for i in s:
	if l == None:
		l = i
	elif i == l:
		c += 1
	else:
		l = i
print(c)


import itertools
i = input()
s = list(input())
print(int(i) - len([k for (k, g) in itertools.groupby(s)]))


t = int(input())
st = input()
count = 0
i = 0
while i < t:
	j = 1
	while i + j < t:
		if st[i] == st[i + j]:
			count += 1
			j += 1
		else:
			break
	i = i + j
print(count)


n = int(input())
word = input()
count = 0
for i in range(0, n - 1):
	if word[i] == word[i + 1]:
		count += 1
	else:
		pass
print(count)


n = int(input())
s = list(input())
done = False
count = 0
while not done:
	done = True
	for i in range(len(s) - 1):
		if s[i] == s[i + 1]:
			s.pop(i)
			count += 1
			done = False
			break
print(count)


no = int(input())
S = input()
(ans, i) = (0, 1)
while i < no:
	if S[i - 1] == S[i]:
		S = S[:i] + S[i + 1:]
		ans += 1
		no -= 1
	else:
		i += 1
print(ans)


t = int(input())
x = input()
y = x.split()
a = []
f = 0
for i in range(0, t - 1):
	n = x[i]
	if x[i] == x[i + 1]:
		f = f + 1
	else:
		pass
print(f)


num_rocks = int(input())
rock_order = input()
same_rocks = 0
for current_index in range(num_rocks - 1):
	if rock_order[current_index] == rock_order[current_index + 1]:
		same_rocks += 1
print(same_rocks)


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


n = int(input(''))
ch = input('')
nb = 0
for i in range(len(ch) - 1):
	if ch[i] == ch[i + 1]:
		nb = nb + 1
print(nb)


n = int(input())
str = input()
flag = 0
for s in range(0, len(str) - 1):
	if str[s] == str[s + 1]:
		flag += 1
	else:
		continue
print(flag)


n = int(input())
w = input()
prev = w[0]
count = 0
for el in range(1, n):
	if w[el] == prev:
		count += 1
	prev = w[el]
print(count)


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


stoneNr = input()
stoneCol = input()
p1 = ''
Rez = 0
for stone in stoneCol:
	if p1 == stone:
		Rez += 1
	p1 = stone
print(Rez)


x = input()
h = input()
s = []
z = 0
for f in range(int(x)):
	if h[f] == 'R':
		s.append('1')
	elif h[f] == 'G':
		s.append('2')
	else:
		s.append('3')
for f in range(0, int(x) - 1):
	if s[f] == s[f + 1]:
		z += 1
print(z)


i = int(input())
c = input()
m = 1
str1 = c[0]
p = 0
while m <= i - 1:
	if c[m] != c[m - 1]:
		str1 += c[m]
	else:
		p += 1
	m += 1
print(p)


a = int(input())
b = input()
count = 0
for (i, j) in enumerate(b):
	try:
		if b[i] == b[i + 1]:
			count += 1
	except IndexError:
		pass
	continue
print(count)


n = int(input())
sequence = list(input())
ans = [sequence[0]]
for char in sequence:
	if char != ans[-1]:
		ans.append(char)
print(len(sequence) - len(ans))


n = int(input())
stone = str(input())
num = 0
for i in range(n):
	if stone[i] == stone[i - 1]:
		num += 1
if num != n and stone[0] != stone[n - 1]:
	print(num)
else:
	print(num - 1)


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


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


n = int(input())
m = input()
s = 0
for x in range(n):
	if 'RR' == m[x:x + 2] or 'GG' == m[x:x + 2] or 'BB' == m[x:x + 2]:
		s += 1
print(s)


number_of_items = int(input())
string = input()
count = 0
for i in range(len(string)):
	try:
		if string[i] == string[i + 1]:
			count += 1
	except IndexError:
		continue
print(count)


def stones():
	n = int(input())
	strinput = input()
	count = 0
	for k in range(0, n - 1):
		if strinput[k] == strinput[k + 1]:
			count += 1
	print(count)

def main():
	stones()
main()


from itertools import groupby
input()
s = input()
ans = 0
for (_, g) in groupby(s):
	l = len(list(g))
	if l > 1:
		ans += l - 1
print(ans)


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


z = input()
arr = input()
counter = 0
se = set()
for i in arr:
	se.add(i)
if len(se) == 1:
	counter = len(arr) - 1
else:
	for i in range(len(arr) - 1):
		if arr[i] == arr[i + 1]:
			counter = counter + 1
		else:
			pass
print(counter)


n = int(input())
string = input()
i = 0
min_stones = 0
while i < len(string):
	col = string[i]
	j = i + 1
	while j < len(string):
		if string[j] != col:
			break
		else:
			min_stones += 1
		j += 1
	i = j
print(min_stones)


kadjf = input()
s = input()
ans = 0
r = 0
while r <= len(s) - 2:
	if s[r] == s[r + 1]:
		ans += 1
	r = r + 1
print(ans)


n = int(input())
s = input()
l = []
count = 0
for a in s:
	l.append(a)
for i in range(len(l) - 1):
	a = l[i]
	b = l[i + 1]
	if a == b:
		count += 1
print(count)


iny = input()
st = input()
current_letter = ''
count = 0
for i in st:
	if i != current_letter:
		current_letter = i
	else:
		count += 1
print(count)


x = int(input())
if 1 <= x <= 50:
	y = input()
	counter = 0
	for i in range(x):
		try:
			if y[i] == y[i + 1]:
				counter += 1
		except:
			None
	print(counter)


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


t = int(input())
s = input()
count = 0
for i in range(0, len(s) - 1):
	if i < len(s) - 1:
		if s[i] == s[i + 1]:
			count += 1
		else:
			continue
print(count)


l = int(input())
a = list(input())
i = 0
while i + 1 < len(a):
	if a[i] == a[i + 1]:
		a.pop(i + 1)
		i -= 1
	i += 1
print(l - len(a))


len_string = input()
string = input()
repetitions = 0
i = 0
while i < len(string) - 1:
	if string[i] == string[i + 1]:
		repetitions += 1
	i += 1
print(repetitions)


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


n = int(input())
stones = input()
s = 0
c = 'X'
for i in stones:
	if i == c:
		s += 1
	c = i
print(s)


n = int(input())
str1 = input()
r = 0
for i in range(n):
	if 'RR' in str1:
		r += 1
		str1 = str1.replace('RR', 'R', 1)
	elif 'GG' in str1:
		r += 1
		str1 = str1.replace('GG', 'G', 1)
	elif 'BB' in str1:
		r += 1
		str1 = str1.replace('BB', 'B', 1)
print(r)


r = input()
s = list(input())
curr = s[0]
count = 0
acc = 0
for v in s:
	if v != curr:
		acc += max(0, count - 1)
		curr = v
		count = 1
	else:
		count += 1
print(acc + max(0, count - 1))


import os
import sys
from math import *
from io import BytesIO, IOBase

def vsInput():
	sys.stdin = open('input.txt', 'r')
	sys.stdout = open('output.txt', 'w')

def array():
	return [int(i) for i in input().split()]
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')
n = int(input())
s = input()
i = 1
ans = 0
while i < len(s):
	while i < len(s) and s[i] == s[i - 1]:
		i += 1
		ans += 1
	i += 1
print(ans)


num = input()
rgb = input()
count = 0
lrgb = [i for i in rgb]
for j in range(len(lrgb[:-1])):
	if lrgb[j] == lrgb[j + 1]:
		count += 1
print(count)


s = int(input())
m = input()
l = []
i = 0
while i < s:
	l.append(m[i])
	i = i + 1
j = 0
count = 0
while j < len(l) - 1:
	a = l[j]
	b = l[j + 1]
	if b == a:
		l = l[:j + 1] + l[j + 2:]
		count = count + 1
	else:
		j = j + 1
print(count)


n = int(input())
s = input().rstrip()
c = []
for i in range(n):
	if i >= 1 and s[i] == s[i - 1]:
		c[len(c) - 1] += 1
	else:
		c.append(1)
print(sum(c) - len(c))


def main():
	n = int(input())
	colors = input().strip()
	current = colors[0]
	num = 1
	for i in range(n):
		if colors[i] != current:
			current = colors[i]
			num += 1
	print(n - num)
main()


n = int(input())
p = input()
l = p[0]
c = 0
for k in range(1, n):
	if l == p[k]:
		c += 1
	l = p[k]
print(c)


input()
_str = input()
_result = 0
for x in range(len(_str)):
	if x != len(_str) - 1:
		if _str[x] == _str[x + 1]:
			_result += 1
print(_result)


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)


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


n = int(input())
lst = input()
lst = list(lst)
count = 0
for it in range(n - 1):
	if lst[it] is lst[it + 1]:
		count += 1
print(count)


s = int(input())
color = input()
counter = 0
for i in range(s - 1):
	if color[i] == color[i + 1]:
		counter += 1
	else:
		continue
print(counter)


q = n = int(input())
s = list(input())
i = 0
while i < n - 1:
	if s[i] == s[i + 1]:
		del s[i + 1]
		n -= 1
		continue
	i += 1
print(q - n)


def remNeighbs(s):
	l = len(s)
	cnt = 0
	i = 0
	j = 0
	flag = 0
	while i < l - 1:
		key = s[i]
		for j in range(i + 1, l):
			if j == l - 1:
				flag = 1
			if key == s[j]:
				cnt += 1
			else:
				i = j
				break
		if flag == 1:
			break
	return cnt
n = int(input())
s = input()
print(remNeighbs(s))


n = int(input())
string = str(input())
word = []
for i in range(len(string)):
	word.append(string[i:i + 1])
count = 0
for i in range(1, n):
	if word[i - 1] == word[i]:
		count += 1
print(count)


def Stones():
	a = int(input())
	b = input()
	c = 0
	for i in range(a):
		if i != 0:
			if b[i] == b[i - 1]:
				c += 1
	print(c)
Stones()


n = int(input())
s = input()
LIST = [s[i] for i in range(len(s))]
num = 0
k = 0
for _ in range(len(LIST) - 1):
	if LIST[k] == LIST[k + 1]:
		del LIST[k + 1]
		num += 1
	else:
		k += 1
print(num)


n = int(input())
stones = input()
c = 0
j = 0
i = 1
while i < len(stones):
	if j == len(stones):
		break
	else:
		if stones[i - 1] == stones[i]:
			j = i
			while j < len(stones) and stones[j - 1] == stones[j]:
				c += 1
				i = j
				j += 1
		i += 1
print(c)


t = input()
x = input()
prev = None
count = 0
for i in range(len(x)):
	if prev == None:
		prev = x[i]
	else:
		if prev == x[i]:
			count = count + 1
		prev = x[i]
print(count)


def find(s):
	for i in range(0, len(s)):
		if s[i] == s[i + 1]:
			s = s[0:i + 1] + s[i + 2:]
			return s
n = int(input())
s = str(input())
r = 'RR'
b = 'BB'
g = 'GG'
flag = 0
count = 0
while flag == 0:
	if r in s or b in s or g in s:
		s = find(s)
		count += 1
	else:
		flag = 1
print(count)


a1 = int(input())
a = input()
i = 0
j = 0
c = 0
while True:
	if i == a1 - 1:
		break
	if a[j + 1] == a[i]:
		c += 1
		j += 1
		if j == a1 - 1:
			break
	else:
		i = j + 1
		j = i
print(c)


a = int(input())
val = 0
list1 = []
_list = list(input())
n = len(_list)
if n <= 1:
	list1.append(_list[0])
else:
	for i in range(n - 1):
		if _list[i] != _list[i + 1]:
			list1.append(_list[i])
	list1.append(_list[-1])
val = len(list1)
print(a - val)


import sys
sys.stdin.readline()
a = sys.stdin.readline()
ok = False
n = 0
while not ok and len(a) > 0:
	out = ''
	ok = True
	for loop in range(1, len(a)):
		if a[loop] != a[loop - 1]:
			out += a[loop - 1]
		else:
			ok = False
			n += 1
	if len(a) >= 2 and a[len(a) - 1] != a[len(a) - 2]:
		out += a[len(a) - 1]
	else:
		ok = False
		n += 1
	a = out
print(n)


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


m = int(input())
st = input()
ans = int()
for i in range(m - 1):
	if st[i] == st[i + 1]:
		ans += 1
print(ans)


num_stones = int(input())
stones = list(input())
removed = []
for i in range(num_stones):
	try:
		if stones[i] == stones[i + 1]:
			removed.append(stones[i + 1])
	except IndexError:
		pass
print(len(removed))


size = input()
x = input()
j = 0
for i in range(len(x) - 1):
	if x[i] == x[i + 1]:
		j += 1
print(j)


o = input()
x = input()
y = ''
t = x[0]
y = y + x[0]
for i in x:
	if t != i:
		y = y + i
		t = i
print(len(x) - len(y))


zeile1 = int(input(''))
zeile2 = input('')
l = list(zeile2)
count = 0
for i in range(zeile1):
	if i < len(l) - 1:
		if l[i] == l[i + 1]:
			l[i] = ' '
			count += 1
print(count)


_ = input('')
word = list(input(''))
ct = 0
for i in range(0, len(word) - 1):
	if word[i] == word[i + 1]:
		ct += 1
print(ct)


n = int(input())
arr = [str(x) for x in input()]
cnt = 0
for i in range(len(arr) - 1):
	if arr[i] == arr[i + 1]:
		cnt += 1
print(cnt)


n = int(input())
str = list(input())
for i in range(n):
	team = []
	for j in range(len(str) - 1):
		if str[j] == str[j + 1]:
			team.append(j)
	if team == []:
		break
	team.reverse()
	for j in team:
		str.pop(j)
print(n - len(str))


def stone_table(n, s):
	i = 0
	t = 0
	if n == 1:
		return 0
	while i + 2 <= n:
		if s[i] == s[i + 1]:
			t += 1
		i += 1
	return t

def main():
	n = int(input())
	s = input()
	print(stone_table(n, s))
main()


in0 = int(input())
in1 = input()
out0 = 0
tempVar = in1[0]
for x in range(1, in0):
	if in1[x] == tempVar:
		out0 += 1
	tempVar = in1[x]
print(out0)


input()
(c, rez, a) = (1, [], input())
for i in range(1, len(a)):
	if a[i] == a[i - 1]:
		c += 1
	else:
		rez.append(c)
		c = 1
rez.append(c)
print(sum(rez) - len(rez))


n = int(input())
string = input()
string_new = []
for i in range(n):
	if i == 0 or string[i] != string[i - 1]:
		string_new.append(string[i])
print(len(string) - len(string_new))


n = input()
a = input()
i = 0
num = 0
while i < len(a) - 1:
	if a[i + 1] == a[i]:
		num += 1
	i += 1
print(num)


n = input()
str = input()
flag = 'wutface'
ammount = 0
for i in str:
	if flag == i:
		ammount += 1
	if flag != i:
		flag = i
print(ammount)


n = int(input())
string = input()
count1 = 0
count2 = 0
count3 = 0
a = 0
if len(string) == n:
	for i in string:
		if i == 'R':
			count1 = count1 + 1
			if count1 >= 2:
				a = a + 1
				string.replace(i, '')
		else:
			count1 = 0
		if i == 'G':
			count2 = count2 + 1
			if count2 >= 2:
				a = a + 1
				string.replace(i, '')
		else:
			count2 = 0
		if i == 'B':
			count3 = count3 + 1
			if count3 >= 2:
				a = a + 1
				string.replace(i, '')
		else:
			count3 = 0
print(a)


input()
stones = input()
count = 0
while True:
	found = False
	for i in ['RR', 'GG', 'BB']:
		if i in stones:
			stones = stones.replace(i, i[0], 1)
			count += 1
			found = True
	if not found:
		break
print(count)


n = int(input())
seq = input() + '_'
output = 0
for i in range(n - 1):
	if seq[i] == seq[i + 1]:
		output += 1
print(output)


a = int(input())
b = list(input())
result = 0
for x in range(a - 1):
	if b[x] == b[x + 1]:
		result = result + 1
	else:
		result = result + 0
print(result)


a = int(input())
b = input()
count = 0
gap = 1
ref = 0
while ref + gap < a:
	if b[ref] == b[ref + gap]:
		count = count + 1
		gap = gap + 1
	else:
		ref = ref + gap
		gap = 1
print(count)


n = int(input())
s = input()[:n]
l = len(s)
remove = 0
i = 0
while i < l:
	for j in range(i + 1, l):
		if s[i] == s[j]:
			i += 1
			remove += 1
		else:
			break
	i += 1
print(remove)


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


length = int(input())
situation = input()
danger = [[situation[0], 1]]
for i in range(1, length):
	if situation[i] == situation[i - 1]:
		danger[-1][1] += 1
	else:
		danger.append([situation[i], 1])
num = 0
for item in danger:
	if item[1] > 1:
		num = item[1] + num - 1
print(num)


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)


x = int(input())
y = input()
y1 = []
for i in y:
	y1.append(ord(i))
count = 0
for i in range(len(y1)):
	if i != len(y1) - 1:
		if y1[i] == y1[i + 1]:
			count += 1
print(count)


a = []
while True:
	try:
		a.append(input().lower())
	except:
		break
n = int(a[0])
s = a[1]
k = 0
for i in range(1, n):
	if s[i] != s[i - 1]:
		continue
	else:
		k += 1
print(k)


n = input()
st = ['Y']
count = int(0)
for x in input():
	if x != st[len(st) - 1]:
		st.append(x)
	else:
		count += 1
print(count)


input()
w = input()
ans = 0
for x in range(len(w) - 1):
	if w[x] == w[x + 1]:
		ans += 1
print(ans)


def Stone(s):
	c = [s[0]]
	j = 0
	for i in range(len(s)):
		if s[i] != c[j]:
			c.append(s[i])
			j += 1
	x = len(s) - len(c)
	return x
n = int(input())
s = input()
print(Stone(s))


n = int(input())
line = input()
s = len(line)
count = 0
k = 0
if s == 1:
	print(count)
else:
	while k < s:
		sum = 1
		for i in range(k, s - 1):
			if str(line[i]) == str(line[i + 1]):
				sum += 1
			else:
				break
		k += sum
		count += sum - 1
	print(count)


n = int(input())
z = input()
prev = z[0]
ans = 0
for q in range(1, n):
	if z[q] == prev:
		ans = ans + 1
	prev = z[q]
print(ans)


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


n = i = 0
input()
a = input()
while i < len(a) - 1:
	if a[i] == a[i + 1]:
		a = a[:i] + a[i + 1:]
		n += 1
	else:
		i += 1
print(n)


n = input()
s = input()
l = len(s)
c = 0
for i in range(0, l - 1):
	if s[i] == s[i + 1]:
		c = c + 1
		i = i + 2
	else:
		i = i + 1
print(c)


while True:
	n = int(input())
	if n in range(1, 51):
		break
while True:
	s = str(input())
	if len(s) == n:
		break
RGB = ['r', 'g', 'b']
count = 0
for i in range(len(s) - 1):
	if s[i].lower() == s[i + 1].lower():
		count += 1
print(count)


i = input()
p = input()
a = len(p)
a = a - 1
l = 0
for e in range(0, int(a)):
	if p[e + 1] == p[e]:
		l = l + 1
print(l)


n = int(input())
stones = str(input())
marks = 0
for i in range(n - 1):
	if stones[i] == stones[i + 1]:
		marks += 1
print(marks)


n = int(input())
S = input()
NewS = ''
NewS += S[0]
for i in range(1, len(S)):
	if S[i] != NewS[-1]:
		NewS += S[i]
print(len(S) - len(NewS))


nums_of_letters = int(input())
letters = str(input())
i = 0
count = 0
while i <= len(letters) - 2:
	if letters[i] == letters[i + 1]:
		count += 1
	i += 1
print(count)


e = input()
s = input()
i = 0
c = 0
while i < len(s):
	j = i + 1
	try:
		while s[i] == s[j]:
			c = c + 1
			j = j + 1
	except:
		break
	i = j
print(c)


n = int(input())
s = input()
i = 0
sum = 0
while i <= len(s) - 2:
	if s[i] != s[i + 1]:
		i += 1
	else:
		s = s[0:i + 1] + s[i + 2:]
		sum += 1
print(sum)


from sys import stdin
_ = stdin.readline()
(it, a, tot) = (iter(stdin.readline().strip()), 'Z', 0)
try:
	while True:
		b = next(it)
		tot += a == b
		a = b
except StopIteration:
	print(tot)


n = int(input())
s = input()
res = 0
if len(s) == 0 or len(s) is 1:
	print(0)
	import sys
	sys.exit()
pre = s[0]
for x in s[1:]:
	if pre is x:
		res += 1
	else:
		pre = x
print(res)


def occurrences(string, sub):
	count = start = 0
	while True:
		start = string.find(sub, start) + 1
		if start > 0:
			count += 1
		else:
			return count
n = int(input())
st = input()
print(occurrences(st, 'RR') + occurrences(st, 'GG') + occurrences(st, 'BB'))


k = input()
n = input().split()
n = [i for i in n[0]]
change = 0
i = 0
j = 0
abs_c = 0
while j < int(k) - 1:
	if n[i] == n[j + 1]:
		change += 1
		j += 1
		if j >= int(k):
			break
	else:
		j += 1
	i = j
print(change)


flag = int(input())
x = input()
counter = 0
for i in range(flag):
	if i + 1 < len(x):
		if x[i] == x[i + 1]:
			counter += 1
print(counter)


digit = int(input())
string = input()
last = string[0]
remove = 0
for i in string[1:]:
	if last == i:
		remove += 1
	else:
		last = i
print(remove)


n = input()
s = str(input())
l = list(s)
m = 0
for i in range(len(l) - 1):
	if l[i] == l[i + 1]:
		m += 1
print(m)


n = int(input())
s = input()
a = []
num = 0
for c in s:
	a.append(c)
for i in range(len(a) - 1):
	if a[i] == a[i + 1]:
		num += 1
print(num)


num = int(input())
color = input()

def counta():
	x = 0
	standard = color[0]
	for i in range(1, num):
		if color[i] == standard:
			x += 1
		else:
			standard = color[i]
	print(x)
counta()


i = int(input())
s = input()
count = 0
prev = s[0]
for _ in range(1, i):
	if s[_] == prev:
		count += 1
	else:
		prev = s[_]
print(count)


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


n = int(input())
x = input()
c = 0
for i in range(n - 1):
	g = x[i]
	h = x[i + 1]
	if g == h:
		c += 1
print(c)


n = input()
ent = input()
lista = []
for e in ent:
	lista.append(e)
cont = 0
for i in range(len(lista) - 1, 0, -1):
	if lista[i] == lista[i - 1]:
		cont += 1
print(cont)


n = int(input())
L = input() + 'F'
cont = 0
eliminados = 0
for k in range(1, n + 1):
	if L[k] == L[k - 1]:
		cont += 1
	else:
		eliminados += cont
		cont = 0
print(eliminados)


def stones(n, s):
	count = 0
	for i in range(n - 1):
		if s[i] == s[i + 1]:
			count += 1
	return count
m = int(input())
t = input()
print(stones(m, t))


n = int(input())
col = str(input())
com = list(col)
count = 0
for i in range(0, n):
	if i == n - 1:
		break
	elif com[i] == com[i + 1]:
		count += 1
	else:
		continue
print(count)


n = int(input())
s = input()
l = list(s)
rem = 0
for i in range(len(s) - 1):
	if s[i] != s[i + 1]:
		continue
	else:
		rem += 1
print(rem)


n = int(input())
m = input()
c = 0
for i in range(1, n):
	a = ord(m[i])
	b = ord(m[i - 1])
	if a == b:
		c = c + 1
print(c)


from sys import stdin

def main():
	n = int(input())
	st = stdin.readline().rstrip()
	count = 0
	for i in range(1, n):
		if st[i] == st[i - 1]:
			count += 1
	print(count)
main()


import sys
n = int(input())
x = input()
ans = 0
z = 0
while z < n:
	cnt = 0
	tmp = x[z]
	k = z
	while k < n and tmp == x[k]:
		cnt += 1
		k += 1
	z = k
	if cnt > 1:
		ans += cnt - 1
print(ans)


n = int(input())
string = input()
cnt = 0
for idx in range(1, n):
	if string[idx] == string[idx - 1]:
		cnt += 1
print(cnt)


n = int(input())
s = list(input())
old = 'x'
count = 0
for i in range(n):
	if s[i] != old:
		old = s[i]
	else:
		count += 1
print(str(count))


n = int(input())
str1 = input()
maxcnt = 0
j = 0
for i in range(1, len(str1)):
	if str1[i] == str1[j]:
		maxcnt += 1
	else:
		j = i
print(maxcnt)


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


n = int(input())
line = input()
num = 0
if n >= 2:
	for i in range(n - 1):
		if line[i] == line[i + 1]:
			num += 1
print(num)


import re
n = int(input())
s = input()
r = re.split('G|B', s)
g = re.split('R|B', s)
b = re.split('R|G', s)
ans = sum((max(0, len(x) - 1) for x in r))
ans += sum((max(0, len(x) - 1) for x in g))
ans += sum((max(0, len(x) - 1) for x in b))
print(ans)


a = input()
b = input()
a = int(a)
cc = 0
p = 0
for i in range(a - 1):
	if b[p] != b[p + 1]:
		cc = cc
	else:
		cc = cc + 1
	p += 1
print(cc)


cnt = int(input())
s = input()
result = 0
ltr = s[0]
for i in range(1, cnt):
	if ltr == s[i]:
		result += 1
	ltr = s[i]
print(result)


n = int(input())
coresPedras = str(input())
count = 0
cond = True
pedra = ''
for cor in coresPedras:
	if cond:
		pedra = cor
		cond = False
	elif cor == pedra:
		count += 1
	else:
		pedra = cor
print(count)


(qtd, pedras) = (int(input()), input())
movimentos = 0
for (index, pedra) in enumerate(pedras):
	if index + 1 < qtd and pedra == pedras[index + 1]:
		movimentos += 1
print(movimentos)


n = int(input())
s = [str(x) for x in input()]
i = 0
while i <= len(s) - 2:
	if s[i] == s[i + 1]:
		s[i] = ''
	i += 1
print(len(s) - len(''.join(s)))


n = int(input())
k = input()
count = 0
for i in range(n - 1):
	if k[i:i + 2] in ['RR', 'BB', 'GG']:
		count += 1
	else:
		continue
print(count)


n = input()
letters = input()
current = 'A'
counter = 0
for i in letters:
	if i == current:
		counter = counter + 1
	current = i
print(counter)


n = int(input())
ncount = 0
l = list(input())
for i in range(n - 1):
	if l[i + 1] == l[i]:
		ncount += 1
print(ncount)


import math
import os
import random
import re
import sys
t = int(input())
a = input()
c = 0
for x in range(1, t):
	if a[x - 1] == a[x]:
		c = c + 1
print(c)


def main():
	(n,) = get_ints()
	s = input()
	s = list(s)
	result = 0
	for x in range(1, len(s)):
		if s[x] == s[x - 1]:
			result += 1
	print(result)

def get_ints():
	return (int(x) for x in input().split(' '))
main()


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


n = int(input())
s = list(input())
per = 'A'
count = 0
for i in s:
	if i == per:
		count += 1
	per = i
print(count)


import sys
from math import sqrt
inp = sys.stdin.readline
read = lambda : list(map(int, inp().split()))

def solve():
	n = int(inp())
	s = inp()
	i = 0
	c = 0
	while i < n:
		j = i + 1
		while s[i] == s[j]:
			j += 1
		c += abs(i - j) - 1
		i = j
	print(c)
solve()


n = int(input())
list = input()
i = 0
for color in range(0, n):
	if color + 1 < n:
		if list[color] == 'R' and list[color + 1] == 'R' or (list[color] == 'G' and list[color + 1] == 'G') or (list[color] == 'B' and list[color + 1] == 'B'):
			i = i + 1
print(i)


import math
inp = lambda : (int, input().split())
n = int(input())
n -= 1
s = input()
res = 0
for i in range(0, n, 1):
	if s[i] == s[i + 1]:
		res += 1
print(res)


pass_num = input()
str = input()
ans = 0
while str.find('RR') != -1 or str.find('GG') != -1 or str.find('BB') != -1:
	if str.find('RR') != -1:
		str = str.replace('RR', 'R', 1)
		ans += 1
	elif str.find('GG') != -1:
		str = str.replace('GG', 'G', 1)
		ans += 1
	else:
		str = str.replace('BB', 'B', 1)
		ans += 1
print(ans)


n = input()
a = list(input())
(c, b) = (0, 'A')
for k in a:
	if k == b:
		c += 1
	b = k
print(c)


no_of_stones = int(input())
stone_string = list(input())
no_of_stone_removed = 0
ind = 0
while ind < int(len(stone_string) - 1):
	if stone_string[ind] == stone_string[ind + 1]:
		del stone_string[ind]
		no_of_stone_removed += 1
		ind = 0
	else:
		ind += 1
print(no_of_stone_removed)


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


inp = int(input())
stones = input()
count = 0
x = stones[0]
for i in range(1, inp):
	if x == stones[i]:
		count += 1
	x = stones[i]
print(count)


import sys
import math
n = int(input())
s = input()
prev = None
c = 0
for i in s:
	if i == prev:
		c = c + 1
	prev = i
print(c)


n = int(input())
s = list(input())
c = 0
for _ in range(n):
	for (e, x) in enumerate(s[:-1]):
		if x == s[e + 1]:
			s.pop(e + 1)
			c += 1
			break
print(c)


def function():
	number = int(input())
	arr = list(input())
	counter = 0
	for i in range(len(arr)):
		if i == len(arr) - 1:
			break
		if arr[i] == arr[i + 1]:
			counter += 1
	print(counter)
function()


n = input()
x = input()
removed = 0
for i in range(len(x) - 1):
	if x[i] == x[i + 1]:
		removed += 1
print(removed)


n = int(input())
s = input()
k = 0
i = 0
l = ''
while i < n - 1:
	if s[i] == s[i + 1]:
		if i == 0:
			l = ''
		else:
			l = s[:i]
		s1 = l + s[i + 1:]
		s = s1[:]
		k = k + 1
		n = n - 1
	else:
		i = i + 1
	l = ''
print(k)


i = int(input())
string = input()
newString = '1'
for u in string:
	if u != newString[-1]:
		newString += u
print(i - (len(newString) - 1))


n = int(input())
colors = input()
prev = colors[0]
changes = 0
for i in range(1, n):
	if colors[i] == prev:
		changes += 1
	else:
		prev = colors[i]
print(changes)


n = int(input())
k = input()
rocks = []
for i in range(n):
	rocks.append(k[i])
length = len(rocks)
if length == 1:
	print(0)
elif length == 2:
	if rocks[0] == rocks[1]:
		print(1)
	else:
		print(0)
elif length == 3:
	if rocks[0] == rocks[1] == rocks[2]:
		print(2)
	elif rocks[0] == rocks[1] and rocks[0] != rocks[2]:
		print(1)
	elif rocks[0] != rocks[1] and rocks[1] == rocks[2]:
		print(1)
	else:
		print(0)
else:
	last_last = 0
	last = 1
	for i in range(2, n):
		if rocks[last_last] == rocks[last]:
			if rocks[last] == rocks[i]:
				rocks[last_last] = 0
				rocks[last] = 0
			else:
				rocks[last_last] = 0
		elif rocks[last] == rocks[i]:
			rocks[last] = 0
		last += 1
		last_last += 1
	while rocks.count(0) > 0:
		rocks.pop(rocks.index(0))
	print(length - len(rocks))


n = int(input())
a = input()
i = 0
count = 0
while i < n:
	j = i + 1
	while j < n and a[i] == a[j]:
		count += 1
		j += 1
	i = j
print(count)


numberOfStones = int(input())
stones = input()
repeat = 0
determine = 0
while repeat < numberOfStones - 1:
	if stones[repeat] == stones[repeat + 1]:
		determine += 1
	repeat += 1
print(determine)


stones = int(input())
row = str(input())
remove = 0
present_color = row[0]
same = 0
i = 1
while i < len(row):
	if present_color == row[i]:
		same += 1
		remove += 1
	else:
		present_color = row[i]
		same = 0
	i += 1
print(remove)


c = int(input())
n = input()
i = 0
p = ''
for x in range(0, c):
	if p == '':
		p = n[x]
	elif n[x] == p:
		i += 1
	else:
		p = n[x]
print(i)


a = int(input())
b = input('')
l = []
z = 1
for i in range(a):
	l.append(b[i])
while z != a:
	if l[z] == l[z - 1]:
		l.remove(l[z])
		a -= 1
	else:
		z += 1
print(len(b) - len(l))


n = int(input())
s = input()
l = []
for i in s:
	l.append(i)
c = 0
for i in range(0, n - 1):
	if l[i] == 'R' and l[i + 1] == 'R' or (l[i] == 'B' and l[i + 1] == 'B') or (l[i] == 'G' and l[i + 1] == 'G'):
		c = c + 1
print(c)


n = int(input())
s = input()
prev = s[0]
ans = 0
for i in s[1:]:
	if i == prev:
		ans += 1
	else:
		prev = i
print(ans)


a = int(input(''))
b = input('')
x = 0
c = a
e = 0
f = a - 1
while f > 0:
	if b[e] == b[a - (c - 1)]:
		x = x + 1
		c = c - 1
		e = e + 1
	else:
		c = c - 1
		e = e + 1
	f = f - 1
print(x)


def removal(total_stones, stones):
	remove = 0
	for i in range(total_stones - 1):
		if stones[i] == stones[i + 1]:
			remove += 1
	return remove
total_stones = int(input())
stones = input()
print(removal(total_stones, stones))


nr = int(input())
table = input()
out = 0
prev = 'W'
for i in range(nr):
	if table[i] == prev:
		out += 1
	prev = table[i]
print(out)


n = int(input())
a = input()
d = 0
f = 0
for i in range(n - 1):
	if a[i] == a[i + 1]:
		d = d + 1
print(d)


n = int(input())
x = input()
l = len(x)
count = 0
com = x[0]
nstr = x[0]
for i in range(l - 1):
	if x[i + 1] != com:
		nstr += x[i + 1]
		com = x[i + 1]
	else:
		count += 1
print(count)


n = input()
str1 = input()
count = 0
for i in range(1, len(str1)):
	if str1[i] == str1[i - 1]:
		count += 1
	else:
		continue
print(count)


number = int(input())
n = input()
n = list(n)
final_list = [0] * 1
final_list[0] = n[0]
for i in range(1, len(n)):
	if n[i] != final_list[-1]:
		final_list.append(n[i])
print(len(n) - len(final_list))


a = int(input())
s = input()
(sum, c, i) = (0, 1, 1)
while i < len(s):
	if s[i] == s[i - 1]:
		c += 1
	else:
		sum += c - 1
		c = 1
	i += 1
print(sum + c - 1)


s = 0
n = input()
c = input()
p = c[0]
for i in c[1:]:
	if i == p:
		s += 1
	p = i
print(s)


n = int(input())
sto = input()
c = 'V'
m = 0
for i in range(n):
	if sto[i] == c:
		m += 1
	else:
		c = sto[i]
print(m)


useless = int(input())
stones = input()
num_del = 0
prev_stone = ''
for x in stones:
	if x == prev_stone:
		num_del += 1
	else:
		prev_stone = x
print(num_del)


total = int(input())
y = input()
x = list(y)
ctr = 0
for i in range(0, len(x) - 1):
	if x[i] == x[i + 1]:
		ctr += 1
print(ctr)


n = int(input())
s = input()
c = 0

def findNeigh(s):
	for i in range(0, len(s) - 1):
		if s[i] == s[i + 1]:
			return i
	return -1
neigh = findNeigh(s)
while neigh != -1:
	c = c + 1
	l = list(s)
	l[neigh] = ''
	s = ''.join(l)
	neigh = findNeigh(s)
print(c)


stoneCount = input()
stone = input()
stoneStore = []
for i in stone:
	stoneStore.append(i)
count = 0
for s in range(1, len(stoneStore)):
	if stoneStore[s - 1] == stoneStore[s]:
		count += 1
print(count)


n = int(input())
line = input()
times = 0
for i in range(n - 1):
	if line[i + 1] == line[i]:
		line.replace(line[i + 1], '')
		times += 1
print(times)


a = int(input())
b = input()
p = 0
while True:
	f = b[0]
	q = p
	for i in range(1, len(b)):
		if b[i - 1] != b[i]:
			f += b[i]
		else:
			p = p + 1
	if q == p:
		break
	b = f
print(p)


N = int(input())
count = 0
string = input()
for each in range(len(string)):
	if each != len(string) - 1:
		if string[each] == string[each + 1]:
			count += 1
print(count)


S = int(input())
Colors = input()
moves = 0
for i in range(S - 1):
	if Colors[i] == Colors[i + 1]:
		moves += 1
print(moves)


n = int(input())
string = input()
i = 0
res = 0
while i < n:
	c = string[i]
	while i + 1 < n and string[i + 1] == c:
		res += 1
		i += 1
	i += 1
print(res)


d = input()
a = input()
v = list(a)
setv = set(v)
initialval = v[0]
count = 0
for i in range(1, len(v)):
	nextval = v[i]
	if nextval == initialval:
		count += 1
	else:
		initialval = nextval
print(count)


n = int(input())
v = []
s = input()
v.append(s[0])
tira = 0
for i in range(1, n):
	v.append(s[i])
	if v[-1] == v[-2]:
		v.pop(-1)
		tira += 1
print(tira)


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


import sys
n = int(sys.stdin.readline().rstrip())
stones = sys.stdin.readline().rstrip()
lastStone = ''
stonesRemoved = 0
for stone in stones:
	if stone == lastStone:
		stonesRemoved += 1
	lastStone = stone
print(stonesRemoved)


x = int(input())
c = 0
y = list(input())
if len(y) != x:
	print(0)
else:
	for i in range(x - 1):
		if y[i] == y[i + 1]:
			c += 1
	print(c)


n = int(input())
stones = input()
count = 0
while n > 1:
	if stones[-n] == stones[-n + 1]:
		count += 1
	n -= 1
print(count)


number = int(input())
stone = str(input())[:number]
result = 0
for i in range(len(stone) - 1):
	if stone[i] == stone[i + 1]:
		result += 1
print(result)


n = int(input())
a = list(input())
i = 0
count = 0
while i < n:
	try:
		if a[i] == a[i + 1]:
			a.remove(a[i])
			count += 1
			i -= 1
		i += 1
	except:
		i += 1
print(count)


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


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


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


n = int(input())
row = input()
last = None
c = 0
for e in row:
	if e == last:
		c += 1
	last = e
print(c)


len = int(input())
s = input()
len_min = len - 1
i = 0
counter = 0
while i < len:
	while i < len_min and s[i] == s[i + 1]:
		counter += 1
		i += 1
	i += 1
print(counter)


piedras = int(input())
entrada = input()
salida = 0
for i in range(0, piedras):
	if piedras > 1 and i > 0:
		if entrada[i] == entrada[i - 1]:
			salida += 1
print(salida)


from sys import stdin
s = [l.rstrip() for l in stdin.readlines()][1]
print(sum((s[i] == s[i + 1] for i in range(len(s) - 1))))


n = int(input())
s = list(input())
c = []
for i in range(n - 1):
	if s[i] == s[i + 1]:
		c.append(1)
print(sum(c))


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


n = int(input())
a = input()
totalToRemove = 0
cChar = ''
cCount = 0
for x in a:
	if cChar == '':
		cChar = x
		cCount = 0
		continue
	if cChar == x:
		cCount += 1
	else:
		cChar = x
		totalToRemove += cCount
		cCount = 0
print(totalToRemove + cCount)


n = int(input())
colours = input()
colours_2 = list()
colours_2.append(colours[0])
ans = 0
for i in colours[1:]:
	if colours_2[-1] != i:
		colours_2.append(i)
	else:
		ans += 1
print(ans)


n = int(input())
st = input()
i = 0
ans = 0
st = list(st)
while i < n - 1:
	if st[i] == st[i + 1]:
		del st[i]
		n -= 1
		ans += 1
	else:
		i += 1
print(ans)


(_, stones, rem) = (input(), str(input()), 0)
for i in range(1, len(stones)):
	if stones[i] == stones[i - 1]:
		rem += 1
print(rem)


a = int(input())
h = 0
b = list(input())
for i in range(len(b) - 1):
	if b[i] == b[i + 1]:
		h += 1
print(h)


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


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


n = int(input())
s = input()
cnt = 0
for i in range(n):
	if i == 0:
		temp = s[i]
	elif s[i] == temp:
		cnt += 1
	else:
		temp = s[i]
print(cnt)


try:
	n = int(input())
	a = input()
	a = list(a)
	ct = 0
	for i in range(n - 1):
		if a[i] == a[i + 1]:
			ct += 1
	print(ct)
except:
	pass


d = {'R': 0, 'G': 0, 'B': 0}
str_ln = int(input())
s = input()
for i in range(1, str_ln):
	if s[i] == s[i - 1]:
		d[s[i]] += 1
sum_d = d['R'] + d['G'] + d['B']
print(sum_d)


input().strip()
stones = input().strip()
first = stones[0]
i = 0
stones = stones[1:]
for stone in stones:
	if stone != first:
		first = stone
	else:
		i += 1
print(i)


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


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


from sys import stdin, stdout

def main():
	n = int(stdin.readline().rstrip())
	stones = str(stdin.readline().rstrip())
	index = 0
	while index < len(stones) - 1:
		if stones[index] == stones[index + 1]:
			stones = stones[:index] + stones[index + 1:]
		else:
			index += 1
	stdout.write(str(n - len(stones)) + '\n')
main()


n = int(input())
m = list(input())
l = []
for i in range(n - 1):
	if m[i] == m[i + 1]:
		l.append(i)
print(len(l))


n = int(input())
thing = list(input())
remove = 0
removed = True
for x in range(len(thing)):
	if removed:
		if x != len(thing) - 1:
			if thing[x] == thing[x + 1]:
				remove += 1
			else:
				removed = False
	elif x != len(thing) - 1:
		if thing[x] == thing[x + 1] or thing[x] == thing[x - 1]:
			remove += 1
			removed = True
	elif thing[x] == thing[x - 1]:
		remove += 1
print(remove)


n = int(input())
color = input()
num = 0
for i in range(0, n - 1):
	if color[i] == color[i + 1]:
		num += 1
	else:
		continue
print(num)


n = int(input())
a = list(input())
counter = 0
for (i, ii) in enumerate(a):
	if i == n - 1:
		break
	if a[i] == a[i + 1]:
		counter += 1
print(counter)


x = int(input())
y = input()
c = 1
for i in range(1, x):
	if y[i] != y[i - 1]:
		c += 1
print(x - c)


from sys import stdin, stdout, stderr, setrecursionlimit
setrecursionlimit(100000)

def debug(*e):
	if not __debug__:
		print(*e, file=stderr)

def dd(*vals):
	import inspect, re
	frame = inspect.getframeinfo(inspect.stack()[1][0])
	vs = re.search('dd\\((.+)\\)', frame.code_context[0]).group(1).split(',')
	if vs:
		debug(','.join(('{0} = {1}'.format(vs[i], v) for (i, v) in enumerate(vals))))

def trace(f):

	def traced(*args, **kw):
		debug('calling {} with args {}, {}'.format(f.__name__, args, kw))
		return f(*args, **kw)
	return traced

def read():
	return stdin.readline().rstrip()

def readarr(sep=None, maxsplit=-1):
	return read().split(sep, maxsplit)

def readint():
	return int(read())

def readintarr(sep=None, maxsplit=-1):
	return [int(a) for a in readarr(sep, maxsplit)]

def write(*args, **kwargs):
	sep = kwargs.get('sep', ' ')
	end = kwargs.get('end', '\n')
	stdout.write(sep.join((str(a) for a in args)) + end)

def writearr(arr, sep=' ', end='\n'):
	stdout.write(sep.join((str(a) for a in arr)) + end)
import math
from heapq import *
n = readint()
s = read()
a = s[0]
r = 0
for c in s[1:]:
	if c == a:
		r += 1
	a = c
write(r)


try:
	n = int(input())
	dist = 0
	l = input()
	for i in range(0, len(l) - 1):
		if l[i] == l[i + 1]:
			dist += 1
	print(dist)
except:
	pass


n = int(input())
str_input = str(input())
list = []
count = 0
for i in range(n):
	list.append(str_input[i])
for i in range(len(list) - 1):
	current = list[i]
	if list[i + 1] == current:
		count += 1
		continue
	else:
		continue
print(count)


def stone_table(n):
	stones = input()
	counter = 0
	for i in range(1, n):
		if stones[i] == stones[i - 1]:
			counter += 1
	print(counter)
n = int(input())
stone_table(n)


n = input()
abc = input()
total = 0
for i in range(len(abc) - 1):
	if abc[i] == abc[i + 1]:
		total += 1
print(total)


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


a = int(input())
c = []
d = []
e = []
b = input()
x = 0
y = 0
z = 0
for i in range(len(b)):
	if b[i] == 'R':
		c.append(i)
	if b[i] == 'G':
		d.append(i)
	if b[i] == 'B':
		e.append(i)
for p in range(len(c) - 1):
	if int(c[p]) + 1 == int(c[p + 1]):
		x += 1
for q in range(len(d) - 1):
	if int(d[q]) + 1 == int(d[q + 1]):
		y += 1
for r in range(len(e) - 1):
	if int(e[r]) + 1 == int(e[r + 1]):
		z += 1
print(x + y + z)


n = int(input())
s = input()
c = 0
prev = None
for l in s:
	if l == prev:
		c += 1
	prev = l
print(c)


i = input()
r = input()
l = len(r)
while r.find('RR') >= 0:
	r = r.replace('RR', 'R')
while r.find('GG') >= 0:
	r = r.replace('GG', 'G')
while r.find('BB') >= 0:
	r = r.replace('BB', 'B')
l1 = len(r)
print(l - l1)


T = input()
word = input()
lw = list(word)
j = 0
ln = len(word)
for i in range(1, ln):
	if word[i - 1] == word[i]:
		j = j + 1
print(j)


n = input()
colors = list(input())
c = int(1)
changes = int(0)
while c < len(colors):
	if colors[c] == colors[c - 1]:
		changes = changes + 1
	c = c + 1
print(changes)


n = int(input())
k = 'A' + input() + 'Z'
flag = 1
res = 0
for i in range(len(k) - 1):
	if flag == 0:
		if k[i] == k[i + 1]:
			res += 1
			flag = 1
	elif k[i] != k[i + 1]:
		flag = 0
	else:
		res += 1
print(str(int(res)))


length = int(input())
table = input()
count = 0
i = 0
if length == 1:
	print('0')
else:
	while i < length - 1:
		if table[i] == table[i + 1]:
			count += 1
		i += 1
	print(count)


num = int(input())
row = input()
out = 0
for i in range(num - 1):
	if row[i] == row[i + 1]:
		out += 1
print(out)


number = input()
n = int(number)
colors = input()
c = ''
for i in range(0, n - 1):
	if colors[i] == colors[i + 1]:
		c = c + colors[i]
print(len(c))


n = int(input())
stone_color = input()
x = 0
for i in range(n):
	if i <= n - 2:
		if stone_color[i] == stone_color[i + 1]:
			x += 1
		if stone_color[i] != stone_color[i + 1]:
			x += 0
	else:
		x += 0
print(x)


t = int(input())
s = input()
a = []
c = 1
for i in range(1, len(s)):
	if s[i - 1] == s[i]:
		c += 1
	else:
		if c > 1:
			a.append(c - 1)
		c = 1
if c > 1:
	a.append(c - 1)
print(sum(a))


n = int(input())
a = list(input())
s = 0
for x in range(n - 1):
	if a[x] == a[x + 1]:
		s += 1
print(s)


length = int(input())
string = list(input())
remove = 0
look_for_repeat = None
for i in range(length):
	if look_for_repeat is None:
		look_for_repeat = string[i]
	elif string[i] == look_for_repeat:
		remove += 1
	else:
		look_for_repeat = string[i]
print(remove)


n = int(input())
Stones = input()
print(sum((Stones[i + 1] == Stones[i] for i in range(n - 1))))


w = input()
s = input()
ch = s[0]
c = 0
for i in range(1, len(s)):
	if s[i] == ch:
		c += 1
	ch = s[i]
print(c)


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)


import re
input()
s = re.findall('[R]+|[G]+|[B]+', input())
print(sum(map(len, s)) - len(s))


input()
a = input()
ans = 0
for i in range(1, a.__len__()):
	if a[i - 1] == a[i]:
		ans += 1
print(ans)


x = int(input())
y = input()
y_src = y
for i in 'RGB':
	while i * 2 in y:
		y = y.replace(i * 2, i)
print(len(y_src) - len(y))


val2 = int(input())
val = input()
count = 0
for i in range(1, len(val)):
	if val[i] == val[i - 1]:
		count += 1
print(count)


input()
string = input()
count = 0
for i in range(len(string)):
	if i >= len(string) - 1:
		continue
	if string[i] == string[i + 1]:
		count += 1
print(count)


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


def stones():
	num_stones = int(input())
	stones = list(input())
	prev = stones[0]
	removed = 0
	for i in range(1, len(stones)):
		if prev == stones[i - removed]:
			stones.remove(prev)
			removed += 1
		else:
			prev = stones[i - removed]
	print(removed)
stones()


n = int(input())
color = input()
remain = [color[0]]
for i in range(len(color) - 1):
	if color[i + 1] == color[i]:
		continue
	else:
		remain.append(color[i + 1])
print(n - len(remain))


length = int(input())
n = input()
index = 1
while index < len(n):
	if n[index] == n[index - 1]:
		n = n[0:index] + n[index + 1:]
	else:
		index += 1
print(length - len(n))


n = int(input())
sym = input()
if n >= 1 and n <= 50:
	count = 0
	for i in range(len(sym) - 1):
		if sym[i] == sym[i + 1]:
			count += 1
	print(count)
else:
	pass


n = int(input())
s = input()
if n > 1:
	d = {'R': 0, 'G': 0, 'B': 0}
	for i in range(1, n):
		if s[i] == s[i - 1]:
			d[s[i]] += 1
	print(sum(d.values()))
else:
	print(0)


def main():
	n = int(input())
	inputs = list(input())
	k = 0
	for i in range(1, n):
		if inputs[i] == inputs[i - 1]:
			k = k + 1
	print(k)
main()


n = int(input())
m = input()
a = []
(r, b, g) = (0, 0, 0)
for i in m:
	if i == 'R':
		r = r + 1
		b = 0
		g = 0
		if r > 1:
			a.append(r)
	elif i == 'B':
		b = b + 1
		r = 0
		g = 0
		if b > 1:
			a.append(b)
	else:
		g = g + 1
		r = 0
		b = 0
		if g > 1:
			a.append(g)
print(len(a))


n = int(input())
a = input()
s = ''
count = 0
for i in range(n):
	ch = a[i]
	if ch == s:
		count += 1
	else:
		s = ch
print(count)


z = int(input())
a = input()
k = 0
p = 0
s = 0
t = 0
for i in a:
	if i == 'R' and k < 1:
		k += 1
		p = 0
		s = 0
	elif i == 'R' and k >= 1:
		t += 1
	elif i == 'G' and p < 1:
		p += 1
		k = 0
		s = 0
	elif i == 'G' and p >= 1:
		t += 1
	elif i == 'B' and s < 1:
		s += 1
		p = 0
		k = 0
	elif i == 'B' and s >= 1:
		t += 1
print(t)


n = int(input())
s = input()
ptr1 = 0
ptr2 = 1
cnt = 0
while ptr1 < n and ptr2 < n:
	while ptr2 < n and s[ptr1] == s[ptr2]:
		ptr2 += 1
		cnt += 1
	ptr1 = ptr2
	ptr2 += 1
print(cnt)


n = input()
N = list(input())
G = []
for x in range(len(N) - 1):
	if N[x] != N[x + 1]:
		G = G + [x + 1]
G = G + [len(N)]
S = [G[0]]
for x in range(len(G) - 1):
	S = S + [G[x + 1] - G[x]]
print(sum(S) - len(S))


qtd = int(input())
entrada = input()
vez = ''
total = 0
for i in range(qtd):
	if vez == entrada[i]:
		total += 1
	else:
		vez = entrada[i]
print(total)


import math
import os
import sys
import re
import itertools
import functools
import operator
(n, s) = (int(input()), input())
print(len(s) - len(''.join((i[0] for i in itertools.groupby(s)))))


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


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


n = int(input())
m = input()
a = 0
for i in range(len(m) - 1):
	if m[i] == 'R' and m[i + 1] == 'R' or (m[i] == 'B' and m[i + 1] == 'B') or (m[i] == 'G' and m[i + 1] == 'G'):
		a = a + 1
print(a)


n = int(input())
s = input()
c = ''
n = 0
num = 0
for i in s:
	if n == 1:
		if i == c:
			num += 1
	c = i
	n = 1
print(num)


import sys
n = int(input())
b = input()
a = [b[i] for i in range(n)]
count = 0
for i in range(n - 1):
	if a[i] == a[i + 1]:
		count += 1
print(count)


input()
stone = input()
prev_stone = stone[0]
result = 0
for s in stone[1:]:
	if prev_stone == s:
		result += 1
	prev_stone = s
print(result)


def main():
	count = input()
	stones = list(input())
	dict = {'R': 1, 'G': 2, 'B': 3}
	need_process = True
	i = 0
	sumation = 0
	while need_process:
		if i + 2 > len(stones):
			need_process = False
			break
		if stones[i] == stones[i + 1]:
			sumation += 1
			del stones[i]
			continue
		i = i + 1
	print(str(sumation))
main()


n = eval(input())
string = input()
counter = 0
for i in range(n - 1):
	if string[i] == string[i + 1]:
		counter += 1
print(counter)


def string_to_lists(string):
	list1 = list()
	for i in string:
		list1.append(i)
	return list1

def CompareNext(number, list):
	n = 0
	out = 0
	while n < number - 1:
		if list[n] == list[n + 1]:
			out += 1
			n += 1
			continue
		else:
			n += 1
	return out
a = int(input())
b = input()
list1 = string_to_lists(b)
print(CompareNext(a, list1))


n = int(input())
stones = input()
while 'RR' in stones or 'GG' in stones or 'BB' in stones:
	stones = stones.replace('RR', 'R')
	stones = stones.replace('GG', 'G')
	stones = stones.replace('BB', 'B')
print(n - len(stones))


n = int(input())
inp = input().upper()
count = 0
for i in range(1, len(inp)):
	if inp[i - 1] == inp[i]:
		count += 1
print(count)


m = int(input())
n = input()
t = 0
b = ''
for i in range(len(n)):
	a = n[i]
	if i != 0:
		b = n[i - 1]
	if b != a:
		for J in range(i + 1, len(n)):
			if n[J] == a:
				t += 1
			else:
				break
print(t)


import os
import sys
from io import BytesIO, IOBase

def solve():
	cnt = 0
	n = int(input())
	s = input()
	for i in range(n - 1):
		if s[i] == s[i + 1]:
			cnt += 1
	print(cnt)
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')
solve()


import sys
inf = sys.stdin
num = int(inf.readline())
color = str(inf.readline()).strip()
counter = 0
prev = color[0]
for i in range(1, num):
	if color[i] == prev:
		counter += 1
	else:
		prev = color[i]
print(counter)


x = int(input())
y = input()
k = 0
for i in range(len(y) - 1):
	if y[i] == y[i + 1]:
		new = y.replace(y[i], '')
		k = k + 1
print(k)


n = input()
n = int(n)
p = input()
f = 0
while n > 1:
	if p[n - 1] == p[n - 2]:
		f += 1
	n -= 1
print(f)


n = int(input())
apples = input()
(last, count) = ('', 0)
for letter in apples:
	if letter != last:
		last = letter
	else:
		count += 1
print(count)


import sys
n = int(input())
a = sys.stdin.readline()
counter = 0
for i in range(len(a) - 1):
	if a[i] == a[i + 1]:
		counter += 1
print(counter)


n = int(input())
stones = input()
i = 1
new_stones = stones[0]
while i < len(stones):
	if stones[i] != stones[i - 1]:
		new_stones = new_stones + stones[i]
	i += 1
print(len(stones) - len(new_stones))


stones = int(input())
colors = [char for char in input()]
counter = 0
for i in range(stones - 1):
	if colors[i] == colors[i + 1]:
		counter += 1
print(counter)


a = int(input())
b = list(input())
c = len(b)
m = 0
for i in range(a - 1):
	if b[m] == b[m + 1] and len(b) > 1:
		b.remove(b[m + 1])
	else:
		m = m + 1
print(int(a) - len(b))


trash = input()
raw_gems = input()

def isPositionValid(position, gems):
	return position >= 0 and position <= len(gems) - 1

def clearTable(gems):
	for (i, gem) in enumerate(gems):
		prv = None
		nxt = None
		if isPositionValid(i - 1, gems):
			prv = gems[i - 1]
		if isPositionValid(i + 1, gems):
			nxt = gems[i + 1]
		if prv != None and prv == gem or (nxt != None and nxt == gem):
			return i
	return -1
anw = 0
while True:
	gem_to_remove = clearTable(raw_gems)
	if gem_to_remove == -1:
		break
	else:
		anw = anw + 1
		raw_gems = raw_gems[:gem_to_remove] + raw_gems[gem_to_remove + 1:]
print(anw)


length = input()
stones = input()
needs_to_be_removed = 0
for (x, y) in zip(stones, stones[1:]):
	if x == y:
		needs_to_be_removed += 1
	else:
		continue
print(needs_to_be_removed)


N = int(input())
s = input()
while 'RR' in s:
	s = s.replace('RR', 'R')
while 'GG' in s:
	s = s.replace('GG', 'G')
while 'BB' in s:
	s = s.replace('BB', 'B')
print(N - len(s))


stones = int(input())
string = input()
flag = 0
for i in range(0, stones - 1):
	if string[i] == string[i + 1]:
		flag += 1
print(flag)


N = int(input())
st = input()
count = 0
for i in range(N):
	if i < N - 1 and st[i] == st[i + 1]:
		count += 1
print(count)


t = int(input())
c = list(input())
cntr = 0
for i in range(t - 1):
	if c[i] == c[i + 1]:
		cntr += 1
print(cntr)


N = int(input())

def solve(string):
	if len(string) == 1:
		return 0
	if len(string) == 2:
		if string[0] == string[1]:
			return 1
		else:
			return 0
	li_string = list(string)
	stack = []
	counter = 0
	char = li_string.pop(0)
	stack.append(char)
	while li_string:
		char = li_string.pop(0)
		if char == stack[-1]:
			counter += 1
		else:
			stack.append(char)
	return counter
string = input()
print(solve(string))


num = input()
string = input('')
new_str = string[:]
for i in range(len(string)):
	if i == len(string) - 1:
		break
	if string[i + 1] == string[i]:
		new_str = new_str[1:]
print(len(string) - len(new_str))


def getLines(num):
	inputLines = []
	for i in range(0, num):
		line = input()
		if line:
			inputLines.append(line)
		else:
			break
	return inputLines

def notZeroPow(num, p):
	return True if num >= 1 and num <= pow(10, p) else False
rc = input()
lines = getLines(1)
s = lines[0]
result = 0
holder = s[0]
for i in range(1, len(s)):
	if s[i] == holder:
		result += 1
	holder = s[i]
print(result)


def replacer(a: str, b: str) -> int:
	count = 0
	entry = a.find(b)
	while entry > -1:
		a = a.replace(b, b[0], 1)
		count += 1
		entry = a.find(b)
	return count
ln = input()
ln = input()
count = replacer(ln, 'RR')
count += replacer(ln, 'GG')
count += replacer(ln, 'BB')
print(count)


n = int(input())
s = input()
k = 0
prev = ''
result = 0
for kamen in s:
	if kamen == prev:
		k += 1
	else:
		result += k
		k = 0
	prev = kamen
result += k
print(result)


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


n = int(input())
stones = input()
prev = None
deleted = 0
for stone in stones:
	if stone == None or stone != prev:
		prev = stone
	else:
		deleted += 1
print(deleted)


n = int(input())
s = list(input())
ans = 0
a1 = s[0]
if n > 1:
	for i in range(1, n):
		a2 = s[i]
		if a1 == a2:
			ans += 1
		a1 = a2
print(ans)


n = int(input())
stones = input()
cont = 0
if n > 1:
	for x in range(1, n):
		if stones[x] == stones[x - 1]:
			cont += 1
print(cont)


number = int(input())
colors = input()
answer = 0
for i in range(len(colors) - 1):
	if colors[i] == colors[i + 1]:
		answer += 1
print(answer)


n = int(input())
l = list(input())
i = 0
k = 0
while i + 1 < len(l):
	if l[i] == l[i + 1]:
		del l[i]
		k += 1
	else:
		i += 1
print(k)


stone = int(input().strip())
color_pattern = input().strip()
count = 0
for i in range(stone - 1):
	if color_pattern[i] == color_pattern[i + 1]:
		count += 1
print(count)


input()
s = input()
c = 0
i = 0
while i < len(s) - 1:
	if s[i] == s[i + 1]:
		s = s[:i] + s[i + 1:]
		c += 1
		i -= 1
	i += 1
print(c)


n = int(input())
x = [i for i in input()]
the_stack = [x[0]]
del x[0]
while x != []:
	if the_stack[-1] == x[0]:
		del x[0]
	else:
		the_stack.append(x[0])
print(n - len(the_stack))


sr = 'RR  BB  GG'
n = int(input())
a = input()
k = []
i = 0
for i in range(len(a) - 1):
	if a[i] + a[i + 1] in sr:
		k.append(i)
print(len(k))


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


n = int(input())
ch = input()
somT = 0
i = 0
while i <= len(ch) - 2:
	som = 0
	test = ch[i] == ch[i + 1]
	while test == True and i <= len(ch) - 3:
		i += 1
		som += 1
		test = ch[i] == ch[i + 1]
	if test == True:
		som += 1
	somT += som
	i += 1
print(somT)


from itertools import groupby
N = int(input())
S = input()
grp = groupby(S)
print(N - len(list(grp)))


n = int(input())
string = input()
counter = 0
for x in range(1, len(string)):
	if string[x - 1] == string[x]:
		counter += 1
print(counter)


n = int(input())
s = str(input())
ans = 0
c = 'A'
cnt = 0
for i in range(0, n):
	if s[i] == c:
		cnt += 1
	else:
		if cnt > 1:
			ans += cnt - 1
		c = s[i]
		cnt = 1
if cnt > 1:
	ans += cnt - 1
print(ans)


def count_remove(a):
	if len(a) == 1:
		return 0
	elif len(a) > 2:
		if a[0] == a[1]:
			return count_remove(a[1:]) + 1
		else:
			return count_remove(a[1:])
	elif a[0] == a[1]:
		return 1
	else:
		return 0
n = input()
a = input()
print(count_remove(a))


n = int(input())
donbale = input()
res = ''
for i in range(n):
	if i < n - 1:
		if donbale[i] == donbale[i + 1]:
			pass
		elif donbale[i] != donbale[i + 1]:
			res += donbale[i]
	if i == n - 1:
		res += donbale[i]
print(len(donbale) - len(res))


n = int(input(''))
table = input('')
minToTake = 0
for i in range(n):
	if i + 1 < n and table[i] is table[i + 1]:
		minToTake += 1
print(minToTake)


n = int(input())
user_input = input()
x = 0
for (index, item) in enumerate(user_input):
	if len(user_input) - 1 == index:
		continue
	if item == user_input[index + 1]:
		x += 1
print(x)


n = input()
row = input()
new_row = [row[0]]
for stone in row:
	if stone != new_row[-1]:
		new_row.append(stone)
print(len(row) - len(new_row))


n = int(input())
h = ''
l = ''
otv = 0
k = 0
while len(h) < n:
	h += input()
for i in h:
	if k == 0:
		l = i
		k += 1
		continue
	if l == i:
		otv += 1
		l = i
	else:
		l = i
print(otv)


n = int(input())
x = list(map(str, input()))
counter = 0
for i in range(len(x) - 1):
	if x[i] == x[i + 1]:
		counter += 1
print(counter)


num_char = int(input())
line = input()
count = 0
for i in range(num_char - 1):
	if line[i] == line[i + 1]:
		count += 1
print(count)


input()
s = input()
ans = 0
a = s[0]
i = 1
while i < len(s):
	if a == s[i]:
		ans += 1
	a = s[i]
	i += 1
print(ans)


inp = int(input())
inp1 = input()
count = 0
flag = 0
for i in range(1, inp):
	if inp1[i] == inp1[i - 1]:
		count = count + 1
	else:
		continue
print(count)


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


n = int(input())
row = input()
count = 0
previous_stone = ''
for i in range(n):
	if previous_stone != '' and row[i] == previous_stone:
		count += 1
	previous_stone = row[i]
print(count)


n = int(input())
a = input()
s = set(a)
t = 0
for i in s:
	while i * 2 in a:
		a = a.replace(i * 2, i, 1)
		t += 1
print(t)


import sys

def Q11(string):
	count = 0
	i = 0
	while i < len(string) - 1:
		if string[i] == string[i + 1]:
			string = string[:i] + string[i + 1:]
			count += 1
		else:
			i += 1
	return count
n = int(sys.stdin.readline().strip())
line = sys.stdin.readline().strip()
print(Q11(line))


n = int(input())
string = input()
before = string[0]
cont = 0
for x in string[1:]:
	after = x
	if after == before:
		cont += 1
	before = after
print(cont)


n = int(input())
st = input()
x = [st[0]]
l = st[0]
for s in st:
	if s != l:
		x.append(s)
		l = s
print(len(st) - len(x))


n = int(input())
npt = input()
stones = [x for x in npt]
e = 0
for i in range(len(stones) - 1):
	if stones[i] == stones[i + 1]:
		stones[i] = '$'
		e += 1
print(e)


inputCount = input()
inputStr = input()
rCount = 0
gCount = 0
bCount = 0
totalCount = 0
for i in inputStr:
	if i == 'R':
		rCount += 1
		gCount = bCount = 0
	elif i == 'G':
		gCount += 1
		rCount = bCount = 0
	else:
		bCount += 1
		gCount = rCount = 0
	if rCount > 1 or gCount > 1 or bCount > 1:
		totalCount += 1
print(totalCount)


n = int(input())
c = input()
co = 0
k = ''
for i in c:
	for j in range(1):
		if k == i:
			co += 1
		k = i
print(co)


n = int(input())
string = input()
samecount = 0
nsamecount = 0
for i in range(len(string) - 1):
	if string[i + 1] != string[i]:
		samecount += 1
	elif string[i + 1] == string[i]:
		nsamecount += 1
if nsamecount == 0:
	print(0)
elif nsamecount > 0:
	print(nsamecount)


(n, s) = (int(input()), input())
(r, g, b) = ('RR', 'GG', 'BB')
c = 0
for i in range(n - 1):
	if s[i:i + 2] == r or s[i:i + 2] == g or s[i:i + 2] == b:
		c += 1
print(c)


x = int(input())
y = input()
z = []
counter = 0
counterp = 0
for i in y:
	z.append(i)
while counter + counterp + 1 != x:
	if z[counter] == z[counter + 1]:
		z.pop(counter)
		counterp += 1
	else:
		counter += 1
print(x - len(z))


def extra_let(string):
	extra = 0
	prev = string[0]
	for i in string[1:]:
		if i == prev:
			extra += 1
		prev = i
	return extra

def main():
	n = int(input())
	row = input()
	print(extra_let(row))
main()


n = int(input())
s = list(input())
count = 0
i = 0
while i < n:
	j = i + 1
	while j < n and s[i] == s[j]:
		s.pop(j)
		n -= 1
		count += 1
	i += 1
print(count)


import re
input()
m = re.findall('([A-Z])(?=\\1)', input())
x = 0
for i in m:
	x += 1
print(x)


v = int(input()) - 1
s = input()
c1 = 0
li = list(s)
i = 0
while i < v:
	if li[i] == li[i + 1]:
		c1 += 1
		del li[i + 1]
		v -= 1
		i -= 1
	i += 1
print(c1)


n = int(input())
stones = list(input())
stones.append('end')
r = ''
g = ''
b = ''
lst = []
cnt = 0
for i in range(n):
	if stones[i] == 'R':
		lst.append(g)
		lst.append(b)
		g = ''
		b = ''
		r += 'R'
	elif stones[i] == 'G':
		lst.append(r)
		lst.append(b)
		r = ''
		b = ''
		g += 'G'
	elif stones[i] == 'B':
		lst.append(r)
		lst.append(g)
		r = ''
		g = ''
		b += 'B'
	if i == n - 1:
		lst.append(r)
		lst.append(g)
		lst.append(b)
for rgb in lst:
	if len(rgb) != 0:
		cnt += len(rgb) - 1
print(cnt)


from sys import stdin

def main():
	n = int(stdin.readline())
	cad = list(stdin.readline().strip())
	(cont, j) = (0, 0)
	while j < len(cad) - 1:
		if cad[j] == cad[j + 1]:
			cont += 1
			del cad[1]
		else:
			j += 1
	print(cont)
main()


n = int(input())
list1 = list(input())
i = 1
s = 0
for m in range(1, n):
	if list1[i] == list1[i - 1]:
		list1.pop(i)
		i = i - 1
		s = s + 1
	i = i + 1
print(s)


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


size = int(input())
stones = input()
previous = stones[0]
count = 0
for stone in stones[1:]:
	if stone == previous:
		count += 1
	else:
		previous = stone
print(count)


N = int(input())
STONES = input()
i = 0
remove = 0
while i < N - 1:
	if STONES[i] == STONES[i + 1]:
		remove = remove + 1
	i = i + 1
print(remove)


n = int(input())
c = input()
y = 0
for i in range(n - 1):
	if c[i] == 'R' and c[i + 1] == 'R':
		y += 1
	elif c[i] == 'G' and c[i + 1] == 'G':
		y += 1
	elif c[i] == 'B' and c[i + 1] == 'B':
		y += 1
print(y)


k = int(input())
w = list(input())
n = 0
while n < len(w) - 1:
	if w[n] == w[n + 1]:
		w.pop(n)
		n = 0
	else:
		n += 1
print(k - len(w))


def main():
	n = int(input())
	s = input()
	remove = remove_stones(n, s)
	print(remove)

def remove_stones(stones, colors):
	if stones == 1:
		return 0
	elif stones == 2:
		if colors[0] != colors[1]:
			return 0
		else:
			return 1
	lst = []
	for letter in colors:
		lst.append(letter)
	return search_calculate(lst, stones)

def search_calculate(colors_list, length):
	last_color = colors_list[0]
	count = 0
	for color in colors_list[1:length]:
		if color == last_color:
			count += 1
			last_color = color
			colors_list.append(color)
		else:
			last_color = color
			colors_list.append(color)
	return count
main()


n = int(input())
original = input()
i = 1
total = 0
last = original[0]
while i < n:
	if original[i] == last:
		total += 1
	else:
		last = original[i]
	i += 1
print(total)


n = int(input())
str1 = input()
i = 0
while str1.find('RR') != -1:
	list1 = str1.partition('RR')
	str1 = list1[0] + 'R' + list1[2]
	i = i + 1
while str1.find('GG') != -1:
	list1 = str1.partition('GG')
	str1 = list1[0] + 'G' + list1[2]
	i = i + 1
while str1.find('BB') != -1:
	list1 = str1.partition('BB')
	str1 = list1[0] + 'B' + list1[2]
	i = i + 1
print(i)


n = int(input())
A = input()
count = 0
for (i, j) in zip(range(0, len(A) - 1), range(1, len(A))):
	if A[i] == A[j]:
		count += 1
print(count)


def sol():
	n = int(input())
	m = input()
	var = 0
	for i in range(1, n):
		if m[i] == m[i - 1]:
			var += 1
	print(var)
try:
	sol()
except:
	pass


input()
s = input()
previous = ''
count = 0
for i in s:
	if previous == i:
		count += 1
	else:
		previous = i
print(str(count))


def main():
	n = int(input())
	s = input()
	print(sum([s[i - 1] == s[i] for i in range(1, n)]))
main()


n = int(input())
colors = input()
i = 0
k = 0
while n > 1:
	if colors[i] == colors[i + 1]:
		k += 1
	n -= 1
	i += 1
print(k)


def main():
	(num, sto, res) = (int(input()), [i for i in input()], [])
	for i in range(num):
		if i + 1 < num:
			if sto[i] == sto[i + 1]:
				res.append(sto[i])
	print(len(res))
main()


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


n = int(input())
stones = input()
removed = 0
i = 0
while i < n - 1:
	if stones[i] == stones[i + 1]:
		removed += 1
		i += 1
	else:
		i += 1
print(removed)


n = int(input())
s = str(input())
counter = 0
for i in range(n - 1):
	if len(set(s[i:i + 2])) == 1:
		counter += 1
print(counter)


n = int(input())
s = input()
a = list(s)
c = 0
x = 0
while x < n - 1:
	i = 1
	while x + i < n and a[x + i] == a[x]:
		c += 1
		i += 1
	x += i
print(c)


n = int(input())
string = input()
oldString = string[:]
Found = True
while Found:
	string = string.replace('RR', 'R')
	string = string.replace('GG', 'G')
	string = string.replace('BB', 'B')
	if any((elem in string for elem in ['RR', 'GG', 'BB'])):
		continue
	else:
		break
print(len(oldString) - len(string))


length = int(input())
colors = input()
sames = 0
for number in range(length - 1):
	if colors[number] == colors[number + 1]:
		sames += 1
print(sames)


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


n = int(input())
s = input()
rs = 0
for i in range(len(s)):
	if i == len(s) - 1:
		break
	elif s[i + 1] == s[i]:
		s.replace(s[i + 1], '')
		rs += 1
print(rs)


input()
s = input()
ans = 0
l = ''
for c in s:
	if c == l:
		ans += 1
	else:
		l = c
print(ans)


n = int(input())
s = input()
last = ''
c = 0
for i in range(n):
	if s[i] == 'R':
		if last == 'R':
			c += 1
		last = 'R'
	elif s[i] == 'G':
		if last == 'G':
			c += 1
		last = 'G'
	else:
		if last == 'B':
			c += 1
		last = 'B'
print(c)


count = int(input())
color = input()
i = 0
k = 0
arr = []
for word in color:
	arr.append(word)
if len(color) == 1:
	print(0)
else:
	while i < len(arr) - 1:
		if arr[i] == arr[i + 1]:
			del arr[i + 1]
			k += 1
		else:
			i += 1
	color = ''
	for item in arr:
		color += item
	print(k)


n = int(input())
word = input()
current = ''
res = 0
for i in range(n):
	if word[i] == current:
		res += 1
	else:
		current = word[i]
print(res)


input()
stones = input()
count = 0
st = 1
for i in stones:
	if i == st:
		count += 1
	else:
		st = i
print(count)


n = int(input())
st = input()
prev = st[0]
total = 0
count = 1
for i in range(1, n):
	if st[i] != prev:
		total = total + count - 1
		prev = st[i]
		count = 1
	else:
		count += 1
print(total + count - 1)


n = int(input())
pedras = str(input())
count = 0
for i in range(1, n):
	pedra = pedras[i - 1]
	pedra_atual = pedras[i]
	count += 1 if pedra == pedra_atual else 0
print(count)


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


n = int(input())
stones = list(map(str, input()))
i = 1
while len(stones) > 1 and i < len(stones):
	if n == 1:
		break
	if stones[i - 1] == stones[i]:
		stones.pop(i)
		i -= 1
	i += 1
print(n - len(stones))


n = int(input())
Str = str(input())
counter = 0
for i in range(len(Str) - 1):
	if Str[i] == Str[i + 1]:
		counter += 1
print(counter)


def solve():
	n = input()
	take_out = 0
	last_ch = None
	for ch in input():
		if ch == last_ch:
			take_out += 1
		last_ch = ch
	print(take_out)
solve()


str_len = int(input())
str_in = input()
count = 0
init = str_in[0]
for i in range(str_len - 1):
	if str_in[i + 1] == init:
		init = str_in[i + 1]
		count += 1
	else:
		init = str_in[i + 1]
print(count)


N = input()
colors = input()
colors = list(colors)
color = None
counter = 0
for i in range(len(colors)):
	if colors[i] != color:
		color = colors[i]
	elif colors[i] == color:
		counter += 1
print(counter)


input()
count = 0
s = input()
r = 'R'
g = 'G'
b = 'B'
initial = s[0]
for i in range(1, len(s)):
	if s[i] == initial:
		count = count + 1
	else:
		initial = s[i]
print(str(count))


def prob266a(n, alist):
	predecessor = alist[0]
	itemsRemoved = 0
	for i in range(1, n):
		if alist[i] == predecessor:
			itemsRemoved += 1
		predecessor = alist[i]
	return itemsRemoved
n = int(input().strip())
alist = list(input().strip())
result = prob266a(n, alist)
print(result)


number_of_stones = int(input())
stones = input()[:number_of_stones]
first = ''
stone_remove = 0
for i in range(number_of_stones):
	if i == 0:
		first = stones[0]
	elif stones[i] == first:
		stone_remove = stone_remove + 1
		first = stones[i]
	else:
		first = stones[i]
print(stone_remove)


n = int(input())
a = input()
count = 0
if len(a) == 1:
	print('0')
else:
	for (i, j) in enumerate(a):
		if a[i + 1] == j:
			count += 1
		if i == n - 2:
			break
	print(count)


_1 = '236a'
_2 = '339a'
_3 = '266a'
count = 0
t = 0
n1 = int(input())
n = list(str(input()))
for i in range(1, n1, 1):
	if n[i] == n[i - 1]:
		count += 1
print(count)


n = input()
s = input()
min_stones_to_remove = 0
previous_colour = s[0]
for colour in s[1:]:
	if colour == previous_colour:
		min_stones_to_remove += 1
	previous_colour = colour
print(min_stones_to_remove)


n = eval(input())
stones = input('')
i = 0
count = 0
while i < n - 1:
	if stones[i] == stones[i + 1]:
		count += 1
	i += 1
print(count)


n = int(input())
s = list(input())
i = 2
answer = 0
while i <= n:
	if s[i - 1] == s[i - 2]:
		tmp = s[i - 1]
		s.remove(tmp)
		n = n - 1
		answer = answer + 1
	else:
		i = i + 1
print(answer)


def not_adjacent(s):
	stack = []
	count = 0
	for i in s:
		if stack and stack[-1] == i:
			count += 1
		else:
			stack.append(i)
	return count
n = int(input())
st = input()
print(not_adjacent(st))


n = int(input())
stones = list(input())
ctr = 0
for x in range(0, n - 1):
	if stones[x] == stones[x + 1]:
		ctr += 1
print(ctr)


h = int(input())
seq = list(input())
i = 0
sum = 0
for i in range(h):
	if i < h - 1 and seq[i + 1] == seq[i]:
		sum += 1
print(sum)


t = int(input())
n = input()
r = 0
c = ''
for i in range(len(n) - 1):
	if n[i] == n[i + 1]:
		c += n[i]
	elif len(c) > 0:
		r += len(c)
		c = ''
if len(c) > 0:
	r += len(c)
print(r)


n = int(input())
a = input()
counter = 0
last = ''
for x in a:
	if last == x:
		counter += 1
	else:
		last = x
print(counter)


sz = int(input())
word = input()
res = 0
i = 0
while i < len(word):
	j = i + 1
	while j < len(word) and word[j] == word[i]:
		j += 1
	res += j - i - 1
	i = j
print(res)


import re
n = int(input())
stones = input()
repeats = [len(i) - 1 for i in re.findall('R{2,}|G{2,}|B{2,}', stones)]
print(sum(repeats))


n = int(input())
lst = list(input())
count = 0
i = 0
while i < n - 1:
	if lst[i] == lst[i + 1]:
		del lst[i]
		count += 1
		n -= 1
	else:
		i += 1
		pass
print(count)


input()
s = input()
stone = []
for i in range(len(s)):
	stone.append(s[i])
x = 0
for i in range(len(stone) - 1):
	if stone[i] == stone[i + 1]:
		x = x + 1
print(x)


number = int(input())
stones = input()
if number == 1:
	print(0)
else:
	count = 0
	for i in range(number):
		if stones[i] == stones[i - 1] and i != 0:
			count += 1
	print(count)


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())
a = input()
res = 0
k = 0
j = 1
while j < n:
	if a[k] == a[j]:
		res += 1
	j += 1
	k += 1
print(res)


stones = int(input())
colors = input()
orig_length = stones
deleted = 0
for stone in range(0, stones - 1):
	if colors[stone + 1] == colors[stone]:
		deleted = deleted + 1
print(deleted)


s = int(input())
str1 = input()
sum = 0
for i in range(len(str1) - 1):
	if str1[i] == str1[i + 1]:
		sum = sum + 1
print(sum)


_ = input()
colors = input()
cur = colors[0]
res = 0
for i in colors[1:]:
	if i == cur:
		res += 1
		continue
	cur = i
print(res)


num = int(input())
string = input()
final = 0
a = 0
b = 2
for i in range(0, num - 1):
	if string[a:b] == 'RR' or string[a:b] == 'GG' or string[a:b] == 'BB':
		final = final + 1
	a = a + 1
	b = b + 1
print(final)


n = int(input())
m = input()
list1 = list(m)
l = 0
for i in range(1, n):
	if list1[i] == list1[i - 1]:
		l += 1
	else:
		pass
print(l)


x = int(input())
y = input()
c = 1
num = 0
while c < x:
	if y[c - 1] == y[c]:
		num += 1
	c += 1
print(num)


n = int(input())
word = input()
print(sum((i == j for (i, j) in zip(word[1:], word))))


n = int(input())
l = input()
total = 0
haha = ['R', 'G', 'B']
for m in haha:
	while m + m in l:
		total += l.count(m + m)
		l = l.replace(m + m, m)
print(total)


n = int(input())
colors = list(input())
result = 0
same = 0
for i in range(1, n):
	if colors[i] == colors[i - 1]:
		same += 1
	else:
		result += same
		same = 0
result += same
print(result)


n = int(input())
s = [x for x in input()]
c = 0
for i in range(0, len(s)):
	if i < len(s) - 1:
		for j in range(i + 1, i + 2):
			if s[i] == s[j]:
				c += 1
print(c)


import sys
num_of_rocks = 0
for line in sys.stdin:
	if num_of_rocks == 0:
		num_of_rocks = int(line.strip())
		continue
	prev_ch = ''
	cnt = 0
	for ch in line.strip():
		if ch == prev_ch:
			cnt += 1
		else:
			prev_ch = ch
	print(cnt)
	break


no_of_color = int(input())
str = input()
count = 0
for i in range(no_of_color - 1):
	if str[i] == str[i + 1]:
		count += 1
print(count)


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


c = 0
n = int(input())
a = input()
for (i, j) in zip(a, a[1:]):
	if i == j:
		c += 1
print(c)


num = int(input())
row = input()
currentStone = None
stonesToRemove = 0
for i in range(0, num):
	if currentStone != row[i]:
		currentStone = row[i]
	else:
		stonesToRemove += 1
print(stonesToRemove)


n = int(input(''))
sequence = list(input(''))
if n == 1:
	print(0)
else:
	for i in range(len(sequence) - 1):
		if sequence[i] == sequence[i + 1]:
			sequence[i] = 'D'
	if sequence[-2] == sequence[-1]:
		sequence[-1] = 'D'
	output = [i for i in sequence if i == 'D']
	print(len(output))


a = int(input())
b = list(str(input()))
i = 1
c = False
d = 0

def boi(b):
	global i, c, d, a
	if c == True:
		d += 1
		c = False
	if i < a:
		if b[i - 1] == b[i]:
			c = True
		i += 1
		boi(b)
boi(b)
print(d)


input()
line = input()
prev = None
ans = 0
cnt = 1
for c in line:
	if prev != c:
		ans += cnt - 1
		prev = c
		cnt = 1
	else:
		cnt += 1
ans += cnt - 1
print(ans)


from sys import stdin, stdout
t = int(stdin.readline())
str1 = input()
global_x = None
count = 0
for i in str1:
	if global_x == None:
		global_x = i
	elif global_x == i:
		count += 1
	else:
		global_x = i
print(count)


def count(stones):
	c = 0
	for i in range(len(stones)):
		if i + 1 < len(stones) and stones[i] == stones[i + 1]:
			c += 1
	return c
n = int(input())
s = input()
print(count(s))


number_of_stones = int(input())
string = input()
i = 0
count = 0
while i + 1 < number_of_stones:
	if string[i] == string[i + 1]:
		string
		count += 1
		i += 1
	else:
		i += 1
print(count)


n = int(input())
stones = input()
before = 'X'
cnt = 0
for i in range(len(stones)):
	if before == stones[i]:
		cnt += 1
	else:
		before = stones[i]
print(cnt)


import sys
input = sys.stdin.readline

def inp():
	return int(input())

def inlt():
	return list(map(int, input().split()))

def insr():
	s = input()
	return list(s[:len(s) - 1])

def invr():
	return map(int, input().split())
n = inp()
s = insr()

def sameneigh(str):
	S = 0
	j = len(str)
	for i in range(1, j):
		d = str[i - 1]
		if str[i] == d:
			S += 1
	return S
if sameneigh(s) == 0:
	print(0)
else:
	print(sameneigh(s))


input()
stones = input()
last = stones[0]
removed = 0
for i in range(1, len(stones)):
	if stones[i] == last:
		removed += 1
	else:
		last = stones[i]
print(removed)


n = int(input())
a = input()
l = []
for e in a:
	l.append(e)
x = 0
s = 0
y = 1
while y != len(l):
	if l[x] == l[y]:
		l.pop(x)
		s += 1
		x = -1
		y = 0
	x += 1
	y += 1
print(s)


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


num = int(input())
colors = input()
remove = 0
for (index, color) in enumerate(colors):
	if index < num - 1 and colors[index] == colors[index + 1]:
		remove += 1
		index += 1
print(remove)


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


import math
import cmath
from decimal import *
from fractions import *
n = int(input())
s = input()
pre = ans = 0
for i in range(1, n):
	if s[i] == s[pre]:
		ans += 1
	else:
		pre = i
print(ans)


val = int(input())
color = list(input())
temp = color
count = 0
for i in range(len(color) - 1):
	if color[i] == color[i + 1]:
		count = count + 1
print(count)


n = int(input())
line = input()
red = 0
blue = 0
green = 0
count = 0
while n > 1:
	if line[n - 1] == line[n - 2]:
		count = count + 1
	n = n - 1
print(count)


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


amount = int(input())
stones = input()
last = stones[0]
result = 0
for s in stones[1:]:
	if s == last:
		result += 1
	else:
		last = s
print(result)


n = input()
s = input()
b = 'none'
cunter = 0
for i in range(1, len(s) + 1):
	c = b
	b = s[0:1]
	s = s[1:]
	if b == c:
		cunter += 1
print(cunter)


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


def Stones_on_the_Table(n_size, string):
	double_ch_count = 0
	for i in range(0, n_size - 1):
		if string[i] == string[i + 1]:
			double_ch_count += 1
	print(double_ch_count)
n_size = int(input())
string = input()
Stones_on_the_Table(n_size, string)


k = int(input())
n = input()
c = 0
m = 0
sum = 0
for i in range(len(n) - 1):
	if n[i] == n[i + 1]:
		c = c + 1
		if c > m:
			m = c
	else:
		sum = sum + m
		c = 0
		m = 0
print(sum + m)


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


import re
n = int(input())
s = input()
r = re.findall('R+', s)
g = re.findall('G+', s)
b = re.findall('B+', s)
x = 0
if len(r) > 0:
	x += sum([len(i) - 1 for i in r])
if len(g) > 0:
	x += sum([len(i) - 1 for i in g])
if len(b) > 0:
	x += sum([len(i) - 1 for i in b])
print(x)


n = int(input())
inp = input()
res = 0
last = inp[0]
for i in range(1, n):
	if inp[i] == last:
		res += 1
	else:
		last = inp[i]
print(res)


from collections import deque
n = int(input())
s = input()
cnt = 0
stack = deque()
stack.append(s[0])
for i in range(1, n):
	stack.append(s[i])
	if stack[-1] == stack[-2]:
		stack.pop()
		cnt += 1
print(cnt)


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


n = int(input())
a = input()
prije = ''
izbaceni = 0
for i in a:
	if i == 0:
		prije = i
	elif i == prije:
		izbaceni += 1
	else:
		prije = i
print(izbaceni)


def colorStones(numberStones, orderStones, count):
	stoneList = []
	for y in orderStones:
		stoneList.append(y)
	for x in range(len(stoneList) - 1):
		if stoneList[x] == stoneList[x + 1]:
			count += 1
		else:
			pass
	return count
s = input()
t = input()
count = 0
print(colorStones(s, t, count))


n = int(input())
inputs = input()
temp = 0
s1 = ''
s2 = ''
for i in range(1, n):
	if inputs[i] == inputs[i - 1]:
		temp += 1
print(temp)


n = int(input())
s = str(input())
while s.count('RR') >= 1 or s.count('BB') >= 1 or s.count('GG') >= 1:
	s = s.replace('RR', 'R')
	s = s.replace('GG', 'G')
	s = s.replace('BB', 'B')
print(n - len(s))


n = int(input())
flg = 0
stone = [x for x in input()]
for i in range(1, len(stone)):
	if stone[i] == stone[i - 1]:
		stone[i - 1] = '*'
		flg += 1
print(flg)


length = input()
l = list(input())
count = 0
for i in range(len(l) - 1):
	if l[i] == l[i + 1]:
		count += 1
print(count)


n = input()
prev = ''
count = 0
for each_char in input():
	if each_char == prev:
		count += 1
	prev = each_char
print(count)


n = int(input())
st = input()
prev_el = ''
i = 0
for el in st:
	if el == prev_el:
		i += 1
	else:
		prev_el = el
print(i)


n = int(input())
a = input()
l = []
k = 0
for i in range(0, n):
	l.append(a[i])
for i in range(0, n - 1):
	if a[i] == a[i + 1]:
		k = k + 1
		continue
	else:
		l.append(a[i])
print(k)


length = int(input())
thing = str(input())
numb = 0
for n in range(length):
	if int(n) == int(len(thing)):
		numb = numb
	elif str(thing[n - 1]) == str(thing[n]):
		numb += 1
if str(thing[0]) == str(thing[int(len(thing)) - 1]):
	numb = numb - 1
print(numb)


(_, stones) = (input(), input())
previous_stone = 'NONE'
take_off_count = 0
for stone in stones:
	if stone == previous_stone:
		take_off_count += 1
	else:
		previous_stone = stone
print(take_off_count)


number = int(input())
stones = input()
count = 0
for i in range(number - 1):
	if len(stones) == 1:
		break
	elif stones[i] == stones[i + 1]:
		count += 1
print(count)


def neighbours(arr):
	count = 0
	adjacent = []
	for i in range(len(arr)):
		if i > 0:
			if arr[i] == arr[i - 1]:
				count += 1
			else:
				adjacent.append(count)
				count = 0
	if count > 0:
		adjacent.append(count)
	else:
		adjacent.append(0)
	return sum(adjacent)
n = int(input())
s = input()
print(neighbours(s))


n = int(input())
strstone = input()
stones = []
for i in strstone:
	stones.append(i)
to_remove = 0
position = 0
while position < len(stones):
	stone = stones[position]
	if len(stones) == 1:
		break
	elif position == 0:
		if stones[position + 1] == stone:
			to_remove += 1
			stones.pop(position)
			position -= 1
	elif position == len(stones) - 1:
		if stones[position - 1] == stone:
			to_remove += 1
			stones.pop(position)
			position -= 1
	elif stones[position + 1] == stone:
		to_remove += 1
		stones.pop(position)
		position -= 1
	elif stones[position - 1] == stone:
		to_remove += 1
		stones.pop(position)
		position -= 1
	position += 1
print(to_remove)


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


ip = int(input())
girdi = list(input())
output = 0
for _ in range(ip - 1):
	if girdi[_] == girdi[_ + 1]:
		output += 1
print(output)


n = int(input())
stones = input()
i = 0
k = 0
for i in range(n):
	if i > 0:
		if stones[i] == stones[nachbar]:
			k += 1
	nachbar = i
print(k)


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


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


N = int(input())
Stones = input()
Moves = 0
for i in range(N - 1):
	if Stones[i] == Stones[i + 1]:
		New_Stones = Stones.replace(Stones[i], '')
		Moves += 1
	else:
		pass
print(Moves)


n = int(input())
s = input().strip()[:n]
s = list(s)
s.append('#%@!@$@@$')
count = 0
for x in range(n):
	if s[x] == s[x + 1]:
		count += 1
print(count)


n = int(input())
a = input()
a = list(a)
y = 0
x = 0
while x in range(len(a) - 1):
	if a[x] == a[x + 1]:
		a.remove(a[x])
		y += 1
		x = x - 1
	else:
		pass
	x += 1
print(y)


a = int(input())
b = input()
c = 0
i = 0
while i < a - 1:
	if b[i] == 'R' and b[i + 1] == 'R':
		c = c + 1
	if b[i] == 'G' and b[i + 1] == 'G':
		c = c + 1
	if b[i] == 'B' and b[i + 1] == 'B':
		c = c + 1
	i = i + 1
print(c)


from sys import stdin
a = int(stdin.readline().rstrip())
stones = stdin.readline().rstrip()

def countCorrections(a, stones):
	if a == 1:
		return 0
	a -= 1
	counter = 0
	i = 0
	while True:
		currStone = stones[i]
		nextStone = stones[i + 1]
		if currStone == nextStone:
			counter += 1
			stones = stones[:i + 1] + stones[i + 2:]
			a -= 1
		else:
			i += 1
		if i == a:
			break
	return counter
print(countCorrections(a, stones))


n = int(input())
s = input()[:n]
c = 0
max1 = 0
p = 0
for i in range(0, len(s) - 1):
	if s[i] == s[i + 1]:
		c += 1
	else:
		if c >= 1:
			max1 += c
		c = 0
print(max1 + c)


def helper(string, n):
	if n < 2:
		return 0
	count = 0
	idx = 0
	next_idx = idx + 1
	while next_idx < n:
		if string[idx] == string[next_idx]:
			next_idx += 1
			count += 1
		else:
			idx = next_idx
			next_idx += 1
	return count
n = int(input())
string = list(input())
ans = helper(string, n)
print(ans)


stone_length = int(input())
stones = input()
l = ''
for i in range(stone_length - 1):
	if stones[i] == 'R' and stones[i + 1] == 'R':
		l += 'R'
	if stones[i] == 'G' and stones[i + 1] == 'G':
		l += 'G'
	if stones[i] == 'B' and stones[i + 1] == 'B':
		l += 'B'
print(len(l))


x = int(input())
y = input()
l1 = []
for i in y:
	l1.append(ord(i))
n = len(l1)
c = 0
for i in range(1, n):
	if l1[i] == l1[i - 1]:
		c += 1
print(c)


n = map(int, input())
stones = input() + '$'
answer = sum((stones[i] == stones[i + 1] for i in range(len(stones) - 1)))
print(answer)


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


def imlazy(db):
	count = 0
	prev = 'NONE'
	for i in db:
		if i == prev:
			count = count + 1
		prev = i
	return count
x = int(input())
y = input()
print(imlazy(y[:x]))


n = int(input())
string = input()
a = 0
i = 1
while i < len(string):
	if string[i] == string[i - 1]:
		a += 1
	i += 1
print(a)


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


nStones = int(input())
stones = input()
count = 0
previous = stones[0]
for n in range(1, nStones):
	if stones[n] == previous:
		count += 1
	previous = stones[n]
print(count)


n = int(input())
n1 = 0
c = input()
c1 = ''
for i in range(n):
	if c[i] == c1:
		n1 += 1
	else:
		c1 = c[i]
print(n1)


import sys
from sys import stdin, stdout
import bisect
from bisect import bisect_left as bl
from bisect import bisect_right as br
import itertools
from collections import Counter
import collections
import math
import heapq
import re

def modinv(n, p):
	return pow(n, p - 2, p)

def cin():
	return map(int, sin().split())

def ain():
	return list(map(int, sin().split()))

def sin():
	return input()

def inin():
	return int(input())

def Divisors(n):
	l = []
	for i in range(1, int(math.sqrt(n) + 1)):
		if n % i == 0:
			if n // i == i:
				l.append(i)
			else:
				l.append(i)
				l.append(n // i)
	return l

def most_frequent(list):
	return max(set(list), key=list.count)

def GCD(x, y):
	while y:
		(x, y) = (y, x % y)
	return x

def ncr(n, r, p):
	t = fact[n] * (ifact[r] * ifact[n - r] % p) % p
	return t

def Convert(string):
	li = list(string.split(''))
	return li

def SieveOfEratosthenes(n):
	global prime
	prime = [True for i in range(n + 1)]
	p = 2
	while p * p <= n:
		if prime[p] == True:
			for i in range(p * p, n + 1, p):
				prime[i] = False
		p += 1
	f = []
	for p in range(2, n):
		if prime[p]:
			f.append(p)
	return f
prime = []
q = []

def dfs(n, d, v, c):
	global q
	v[n] = 1
	x = d[n]
	q.append(n)
	j = c
	for i in x:
		if i not in v:
			f = dfs(i, d, v, c + 1)
			j = max(j, f)
	return j

def main():
	n = inin()
	s = sin()
	count = 0
	s = list(s)
	for i in range(n - 1):
		if s[i] == 'R':
			if s[i + 1] == 'R':
				count += 1
		if s[i] == 'G':
			if s[i + 1] == 'G':
				count += 1
		if s[i] == 'B':
			if s[i + 1] == 'B':
				count += 1
	print(count)
py2 = round(0.5)
if py2:
	from future_builtins import ascii, filter, hex, map, oct, zip
	range = xrange
import os, sys
from io import IOBase, BytesIO
BUFSIZE = 8192

class FastIO(BytesIO):
	newlines = 0

	def __init__(self, file):
		self._file = file
		self._fd = file.fileno()
		self.writable = 'x' in file.mode or 'w' in file.mode
		self.write = super(FastIO, self).write if self.writable else None

	def _fill(self):
		s = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
		self.seek((self.tell(), self.seek(0, 2), super(FastIO, self).write(s))[0])
		return s

	def read(self):
		while self._fill():
			pass
		return super(FastIO, self).read()

	def readline(self):
		while self.newlines == 0:
			s = self._fill()
			self.newlines = s.count(b'\n') + (not s)
		self.newlines -= 1
		return super(FastIO, self).readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.getvalue())
			(self.truncate(0), self.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		if py2:
			self.write = self.buffer.write
			self.read = self.buffer.read
			self.readline = self.buffer.readline
		else:
			self.write = lambda s: self.buffer.write(s.encode('ascii'))
			self.read = lambda : self.buffer.read().decode('ascii')
			self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')
main()


def main():
	n = input()
	mask = input()
	result = 0
	previous = None
	for i in mask:
		if i == previous:
			result += 1
		else:
			previous = i
	return result

def ints_from_input():
	return (int(i) for i in input().split())
print(main())


import sys
n = int(input())
s = input().strip()
counter = 0
pointer = 0
s1 = s[0]
for i in range(1, n):
	if s[i] != s1[len(s1) - 1]:
		s1 += s[i]
print(len(s) - len(s1))


x = eval(input())
m = str(input())
i = 0
c = 0
while i < len(m) - 1:
	if m[i] == m[i + 1]:
		c += 1
	i += 1
print(c)


amount = int(input())
s = input()
l = list(s)
a = 0
for (i, v) in enumerate(l):
	try:
		if l[i] == l[i + 1]:
			a += 1
	except:
		continue
print(a)


n = int(input())
s = list(input())
if s[0] == 'R':
	s.insert(0, 'G')
else:
	s.insert(0, 'R')
b = [0, 0]
for i in range(2, n + 1):
	b.append(0)
	j = i - 1
	if s[i] == 'R':
		while s[j] == 'R':
			j -= 1
	if s[i] == 'G':
		while s[j] == 'G':
			j -= 1
	if s[i] == 'B':
		while s[j] == 'B':
			j -= 1
	b[i] = b[j] + (i - j - 1)
print(b[n])


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


n = int(input())
m = input()
l = []
j = 0
for i in range(n):
	l.append(m[i])
for i in range(1, n):
	if l[i] == l[i - 1]:
		j = j + 1
print(j)


n = int(input())
string = input()
j = 0
ans = 0
for i in range(n - 1):
	if string[i] == string[i + 1]:
		j = j + 1
	else:
		ans = ans + j
		j = 0
ans = ans + j
print(ans)


n = int(input())
s = input()
num_removal = 0
cur = ''
for c in s:
	if c == cur:
		num_removal += 1
	else:
		cur = c
print(num_removal)


n = int(input())
s = input()
prev = ''
rem = 0
for stone in s:
	if stone == prev:
		rem += 1
	prev = stone
print(rem)


input()
b = input()
s = 0
for x in range(len(b) - 1):
	if b[x] == b[x + 1]:
		s += 1
print(s)


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


length = int(input())
l = input()
summa = 0
for i in range(length):
	if i + 1 != length:
		if l[i] == l[i + 1]:
			summa += 1
print(summa)


n = int(input())
l = input()
c = 0
for i in range(n - 1):
	if l[i] + l[i + 1] == 'RR' or l[i] + l[i + 1] == 'BB' or l[i] + l[i + 1] == 'GG':
		c += 1
print(c)


n = int(input())
prev = ''
answer = 0
x = input()
for counter in range(0, n):
	if x[counter] is prev:
		answer += 1
	prev = x[counter]
print(answer)


n = int(input())
s = input()
num_s = 0
for num in range(n):
	if num == n - 1:
		break
	if s[num] == s[num + 1]:
		num_s += 1
print(num_s)


while True:
	try:

		class MinColor:

			def __init__(self):
				self.stak = []
				self.color = 0
				self.c = ''

			def inputt(self):
				n = int(input())
				self.c = input()

			def solve(self):
				for i in range(len(self.c)):
					if self.stak and self.stak[-1] == self.c[i]:
						self.color += 1
					else:
						self.stak.append(self.c[i])
				print(self.color)
				del self.c
		if __name__ == '__main__':
			c1 = MinColor()
			c1.inputt()
			c1.solve()
	except EOFError:
		break


l = int(input())
a = input()
c = 0
i = 0
while i < l - 1:
	n = a[i]
	if n == a[i + 1]:
		c += 1
		j = i + 2
		while j < l:
			if n != a[j]:
				break
			else:
				c += 1
			j += 1
		i = j
	else:
		i += 1
print(c)


count = 0
n = int(input())
l = input()
temp = ''
for i in l:
	if i == temp:
		count += 1
	temp = i
print(count)


n = input()
a = input()
c = a[0]
g = 1
for l in a:
	if l != c:
		c = l
		g += 1
print(len(a) - g)


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


nColors = int(input())
sColors = input()
n = 0
for (i, chary) in enumerate(sColors):
	if i + 1 < nColors:
		if chary == sColors[i + 1]:
			n += 1
print(n)


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


n = input()
s = input()
bad = ['RR', 'BB', 'GG']
res = 0
flag = True
while flag:
	flag = False
	for c in bad:
		if s.find(c) != -1:
			flag = True
			res += 1
			s = s.replace(c, c[0], 1)
print(res)


import sys
withFile = 0
if withFile == 1:
	fin = open('input.txt', 'r')
	fout = open('output.txt', 'w')

def getl():
	if withFile == 0:
		return input()
	else:
		return fin.readline()

def printl(s):
	if withFile == 0:
		print(s)
	else:
		fout.write(str(s))

def get_arr():
	x = getl().split(' ')
	if x[-1] == '':
		x = x[:-1]
	return list(map(int, x))
get_arr()
s = getl()
ans = []
for c in s:
	if len(ans) == 0 or ans[-1] != c:
		ans.append(c)
printl(len(s) - len(ans))
if withFile == 1:
	fin.close()
	fout.close()


def user(stones):
	count = 0
	stone_size = len(stones)
	for x in range(stone_size):
		if x < stone_size - 1:
			if stones[x + 1] == stones[x]:
				count += 1
	print(count)
score = input()
stone = input()
stones = [x for x in stone]
user(stones)


l = input()
l = int(l)
s = input()
if l == 1:
	print(0)
else:
	rem = 0
	i = 0
	x = 1
	while i < l:
		if s[i] == 'R':
			for j in range(i + 1, l):
				if s[j] == 'R':
					rem += 1
				else:
					i = j
					break
		elif s[i] == 'G':
			for j in range(i + 1, l):
				if s[j] == 'G':
					rem += 1
				else:
					i = j
					break
		elif s[i] == 'B':
			for j in range(i + 1, l):
				if s[j] == 'B':
					rem += 1
				else:
					i = j
					break
		if j == l - 1:
			break
	print(rem)


def proA(arr):
	ans = 0
	for i in range(1, len(arr)):
		if arr[i - 1] == arr[i]:
			ans += 1
	return ans
t = int(input())
arr = list(input())
print(proA(arr))


n = int(input())
s = input()
bef = ''
ans = 0
for v in s:
	if bef == v:
		ans += 1
	bef = v
print(ans)


n = int(input())
lst = list(input())[:n]
c = 0
for (i, j) in enumerate(lst):
	if i < len(lst) - 1:
		if lst[i] == lst[i + 1]:
			c += 1
print(c)


(l, s) = (input(), 0)
for i in input():
	if i == l:
		s += 1
	else:
		l = i
print(s)


no_of_stones = int(input())
colors_of_stone = input()
count = 0
for i in range(no_of_stones - 1):
	if colors_of_stone[i] == colors_of_stone[i + 1]:
		count += 1
print(count)


l = int(input())
a = input()
a = list(a)
b = a
sol = 0
for i in range(l - 1):
	if a[i] == a[i + 1]:
		sol += 1
print(sol)


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


num = int(input())
li = list(input())
n = 0
for i in range(len(li) - 1):
	if li[i] == li[i + 1]:
		n += 1
	else:
		pass
print(n)


a = input()
s = input()
v = 0
for x in range(len(s) - 1):
	if s[x] == s[x + 1]:
		v += 1
print(v)


num = int(input())
colors = input().rstrip('\n')
counter = 0
for index in range(len(colors) - 1):
	if colors[index] == colors[index + 1]:
		counter += 1
print(counter)


n_stones = int(input())
stones = input().strip()
prev = stones[0]
delete = 0
for j in range(1, n_stones):
	if stones[j] == prev:
		delete += 1
	else:
		prev = stones[j]
print(delete)


y = int(input())
z = input()
ans = 0
for a in range(0, y - 1):
	if z[a] == z[a + 1]:
		ans += 1
print(ans)


stnum = int(input())
stones = input()
freq = 0
for c in range(0, stnum - 1):
	if stones[c] == stones[c + 1]:
		freq = freq + 1
print(freq)


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


a = int(input())
b = list(input())
c = len(b)
d = 0
e = 0
while d in range(c - 1):
	a = b[d]
	if b[d + 1] == a:
		e = e + 1
	else:
		e = e
	d = d + 1
print(e)


numStones = int(input())
colors = str(input())
stones_to_remove = 0
for i in range(numStones - 1, 0, -1):
	if colors[i] == colors[i - 1]:
		stones_to_remove += 1
print(stones_to_remove)


num = input()
st = str(input())
count = 0
for i in range(len(st) - 1):
	if st[i] == st[i + 1]:
		count += 1
print(str(count))


input()
string = input()
init_len = len(string)
prev_len = init_len
while True:
	for letter in 'RGB':
		string = string.replace(letter * 2, letter)
	current_len = len(string)
	if prev_len == current_len:
		break
	prev_len = current_len
print(init_len - current_len)


lixo = int(input())
stones = str(input())
i = 0
count = 0
while i < len(stones) - 1:
	if stones[i] == stones[i + 1]:
		count += 1
	i += 1
print(count)


import sys
n = int(sys.stdin.readline()[:-1])
stones = sys.stdin.readline()[:-1]
ref = stones[0]
count = 0
for i in range(1, len(stones)):
	if stones[i] == ref:
		count += 1
	else:
		ref = stones[i]
print(count)


count_stone = input()
line = list(input())
count = 0
last = None
for letter in line:
	if letter == last:
		count += 1
	last = letter
print(count)


n = input()
k = input()
p = k[0]
c = 0
for i in k[1:]:
	if i == p:
		c += 1
	else:
		p = i
print(c)


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


def stone(a, b):
	c = 0
	for i in range(len(b) - 1):
		if b[i] == b[i + 1]:
			c += 1
	print(c)
stone(int(input()), input())


n = int(input())
line = input()
remove = 0
i = 0
while i < n:
	if line[i] == 'R':
		while i < n:
			if line[i] != 'R':
				break
			remove += 1
			i += 1
		remove -= 1
		i -= 1
	if line[i] == 'G':
		while i < n:
			if line[i] != 'G':
				break
			remove += 1
			i += 1
		remove -= 1
		i -= 1
	if line[i] == 'B':
		while i < n:
			if line[i] != 'B':
				break
			remove += 1
			i += 1
		remove -= 1
		i -= 1
	i += 1
print(remove)


n = int(input())
s = input()
pre = s[0]
counter = 0
for curr in s[1:]:
	if curr == pre:
		counter += 1
	pre = curr
print(counter)


n = int(input())
seq = list(map(str, input().upper()))
S = []
for x in seq:
	S.append(x)
i = 0
count = 0
while i < n:
	if i != n - 1:
		if S[i] == S[i + 1]:
			count += 1
	else:
		break
	i += 1
print(count)


counter = 0
anterior = ' '
n = int(input())
x = list(input())
for i in range(n):
	if x[i] == anterior:
		counter += 1
	anterior = x[i]
print(counter)


n = int(input())
s = input()
ln = len(s)
count = 0
ans = ''
for i in range(ln - 1):
	nxt = s[i + 1]
	cur = s[i]
	if cur == nxt:
		count += 1
print(count)


a = int(input())
b = list(input())
c = 0
element = b[0]
if len(b) > a:
	print('length is too long')
else:
	for x in range(1, a):
		if element == b[x]:
			c += 1
		else:
			element = b[x]
	print(c)


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


def no_to_remove(colours):
	no_to_remove = 0
	for (index, colour) in enumerate(colours):
		if index < len(colours) - 1:
			if colour == colours[index + 1]:
				no_to_remove += 1
	return no_to_remove

def main():
	n = int(input())
	stone_colours = ' '.join(input()).split()
	amount_to_remove = no_to_remove(stone_colours)
	print(amount_to_remove)
main()


n = int(input())
s = [i for i in input()]
c = 0
j = 0
while j < n - 1:
	if s[j] == s[j + 1]:
		del s[j]
		c += 1
		j = 0
		n -= 1
		continue
	j += 1
print(c)


n = int(input())
a = list(str(input()))
prev = a[0]
s = 0
for i in range(1, n):
	if a[i] == prev:
		s += 1
	else:
		prev = a[i]
print(s)


len_word = str(input())
word = input()
word_list = list(word)
counter = 0
current = 0
while current < len(word_list) - 1:
	for test in range(current + 1, len(word_list)):
		if word_list[current] == word_list[test]:
			counter += 1
		else:
			break
	current = test
print(counter)


(z, zz) = (input, lambda : list(map(int, z().split())))
zzz = lambda : [int(i) for i in stdin.readline().split()]
(szz, graph, mod, szzz) = (lambda : sorted(zz()), {}, 10 ** 9 + 7, lambda : sorted(zzz()))
from string import *
from re import *
from collections import *
from queue import *
from sys import *
from collections import *
from math import *
from heapq import *
from itertools import *
from bisect import *
from collections import Counter as cc
from math import factorial as f
from bisect import bisect as bs
from bisect import bisect_left as bsl
from itertools import accumulate as ac
from itertools import permutations as permu

def lcd(xnum1, xnum2):
	return xnum1 * xnum2 // gcd(xnum1, xnum2)

def prime(x):
	p = ceil(x ** 0.5) + 1
	for i in range(2, p):
		if x % i == 0 and x != 2 or x == 0:
			return 0
	return 1

def dfs(u, visit, graph):
	visit[u] = True
	for i in graph[u]:
		if not visit[i]:
			dfs(i, visit, graph)
n = int(z())
lst = z()
ans = 0
t = 0
while True:
	t = 0
	for i in range(len(lst) - 1):
		if lst[i] == lst[i + 1]:
			ans += 1
			t = 1
			lst = lst[:i] + lst[i + 1:]
			break
	if t == 0:
		break
print(ans)


import re
n = int(input())
s = input()
s = re.sub('RR+', 'R', s)
s = re.sub('GG+', 'G', s)
s = re.sub('BB+', 'B', s)
print(n - len(s))


length = input()
s = input()
checking = None
count = 0
for i in s:
	if checking is None:
		checking = i
	elif checking != i:
		checking = i
	else:
		count += 1
print(count)


input()
entrada = input()
n = 0
ans = 0
for i in range(len(entrada)):
	if n > 0:
		n -= 1
		continue
	for j in range(i + 1, len(entrada)):
		if entrada[j] == entrada[i]:
			ans += 1
			n += 1
		else:
			break
print(ans)


n = input()
b = input()
c = 0
j = b[0]
for i in b:
	if j == i:
		c += 1
	j = i
print(c - 1)


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


a = int(input())
b = input()
c = ''
d = ''
e = 0
for i in b:
	c = d
	d = i
	if c == d:
		e = e + 1
print(e)


no_of_stone = int(input())
colour_string = input()
remove = 0
for i in range(no_of_stone - 1, 0, -1):
	if colour_string[i] == colour_string[i - 1]:
		remove += 1
print(remove)


x = int(input())
y = input()
z = list(y)
c = 0
for i in range(len(z) - 1):
	a = z[i]
	b = z[i + 1]
	if a == b:
		c += 1
print(c)


n = int(input())
li = list(input())
R = 1
B = 1
G = 1
for i in range(n - 1):
	if li[i] == 'R' and li[i + 1] == 'R':
		R = R + 1
	elif li[i] == 'B' and li[i + 1] == 'B':
		B = B + 1
	elif li[i] == 'G' and li[i + 1] == 'G':
		G = G + 1
red = R - 1
blue = B - 1
green = G - 1
s = red + blue + green
print(s)


n = int(input())
s = input()
k = 0
j = 0
while True:
	if j + 1 < len(s):
		if s[j] == s[j + 1]:
			s = s[:j] + s[j + 1:]
			k += 1
		else:
			j += 1
	else:
		break
print(k)


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


input()
colors = list(input())
result = 0
for i in range(1, len(colors)):
	x = colors[i]
	if colors[i - 1] == colors[i]:
		result += 1
print(result)


n = int(input())
s = input()
pre = 'A'
count = 0
for c in s:
	if pre == c:
		count += 1
	pre = c
print(count)


n = int(input())
a = input()
i = 0
j = 0
b = []
c = 0
while i < n and j < n:
	if a[i] == a[j]:
		c = c + 1
		j = j + 1
	else:
		b.append(c)
		c = 0
		i = j
if c != 0:
	b.append(c)
c = 0
for i in b:
	c = c + (i - 1)
print(c)


t = int(input())
s = input()
a = s[0]
c = 1
su = 0
for i in range(1, t):
	if s[i] == a:
		c += 1
	else:
		su = su + c - 1
		c = 1
		a = s[i]
if c >= 2:
	su = su + c - 1
print(su)


n = input()
n2 = input()
ctr = 0
i = 0
while i + 1 < len(n2):
	if n2[i] == n2[i + 1]:
		ctr += 1
	i += 1
print(ctr)


a = int(input())
b = list(input())
ans = 0
for n in range(a - 1):
	if b[n] == b[n + 1]:
		ans += 1
	else:
		continue
print(ans)


n = int(input())
lis = list(input())
k = 0
while n > 1:
	if lis[n - 1] == lis[n - 2]:
		lis[n - 1] = 0
		k += 1
	n -= 1
print(k)


n = int(input())
ch = str(input())
t = ch[0]
r = 0
for k in range(1, n):
	if ch[k] == t:
		r += 1
	else:
		t = ch[k]
print(r)


n = int(input())
m = str(input())
output = 0
for i in range(0, n):
	if i < n - 1:
		if m[i] == 'R':
			if m[i + 1] == 'R':
				output += 1
		if m[i] == 'B':
			if m[i + 1] == 'B':
				output += 1
		if m[i] == 'G':
			if m[i + 1] == 'G':
				output += 1
print(output)


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


length = int(input())
chr = input()
i = 0
counter = 0
while i < length:
	if i + 1 == length:
		break
	if chr[i] == chr[i + 1]:
		counter += 1
	i += 1
print(counter)


number = int(input())
stones = input()
current = stones[0]
count = 0
for i in range(1, number):
	if current == stones[i]:
		count += 1
	current = stones[i]
print(count)


n = int(input())
s = [c for c in input()]
prev = ''
ans = 0
i = 0
while i != len(s):
	c = s[i]
	if c == prev:
		prev = c
		s.remove(c)
		ans += 1
	else:
		prev = c
		i += 1
print(ans)


l = int(input())
game = input()
l = len(game)
count = 0
for i in range(0, l):
	if game[i] == 'R':
		if i < l - 1 and game[i + 1] == 'R':
			count += 1
	elif game[i] == 'G':
		if i < l - 1 and game[i + 1] == 'G':
			count += 1
	elif i < l - 1 and game[i + 1] == 'B':
		count += 1
print(count)


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


num = int(input())
stone = input()
exclude = 0
for i in range(num):
	if not i:
		continue
	if stone[i] == stone[i - 1]:
		exclude += 1
print(exclude)


c = input()
s = input()
x = list(s)
(i, counter) = (0, 0)
while i < len(x) - 1:
	if x[i] == x[i + 1] and x[i] != '-':
		x[i] = '-'
		counter += 1
	i += 1
print(counter)


n = int(input())
code = input()
count = 0
test = code[0]
for i in range(1, len(code)):
	if code[i] == test:
		count += 1
	else:
		test = code[i]
print(count)


n = int(input())
inp = input()
c = 0
for index in range(len(inp) - 1):
	if inp[index] == inp[index + 1]:
		c += 1
print(c)


n = int(input())
text = input()
last = 0
fin = 1
rez = 0
while fin < n:
	if text[fin] == text[last]:
		rez += 1
	else:
		last = fin
	fin += 1
print(rez)


panjang = int(input())
h = input()
hitung = 0
for i in range(len(h)):
	for j in range(i + 1, len(h)):
		if j - i == 1 and h[j] == h[i] == 'R':
			hitung += 1
		elif j - i == 1 and h[j] == h[i] == 'G':
			hitung += 1
		elif j - i == 1 and h[j] == h[i] == 'B':
			hitung += 1
print(hitung)


n = int(input())
stone = input()
whatstone = len(stone)
i = 0
laststone = 1
while i < n - 1:
	if stone[i] != stone[i + 1]:
		laststone = laststone + 1
	i = i + 1
moved = whatstone - laststone
print(moved)


n = int(input().strip())
a = input().strip()
l = 'I'
cnt = 1
ans = 0
for i in range(n):
	if a[i] == l:
		cnt += 1
	else:
		l = a[i]
		ans += cnt - 1
		cnt = 1
ans += cnt - 1
print(ans)


n = int(input())
s = [i for i in input()]
sol = 0
newS = [ele for (i, ele) in enumerate(s) if i == len(s) - 1 or ele != s[i + 1]]
print(abs(len(newS) - len(s)))


import sys

def main():
	s = sys.stdin.read()
	lines = s.splitlines()
	n = int(lines[0])
	data = lines[1]
	result = 0
	for i in range(n - 1):
		if data[i] == data[i + 1]:
			result += 1
	print(result)
main()


import sys
local_launch = False
try:
	open('LOCAL').read()
	local_launch = True
except:
	pass
input_data = open('INPUT.txt').read() if local_launch else sys.stdin.read()
done = {'i': 0}
tokens = input_data.split()

def next_token():
	result = tokens[done['i']]
	done['i'] += 1
	return result

def next_int():
	return int(next_token())

def next_str():
	return next_token()

def sum(a):
	z = 0
	for i in range(len(a)):
		z = z + a[i]
	return z

def max(a):
	maz = a[0]
	for i in range(len(a)):
		if maz < a[i]:
			maz = a[i]
	return maz

def min(a):
	mix = a[0]
	for i in range(len(a)):
		if mix > a[i]:
			mix = a[i]
	return mix

def argmax(a):
	id = 0
	maz = a[0]
	for i in range(len(a)):
		if maz < a[i]:
			maz = a[i]
			id = i
	return id

def argmin(a):
	id = 0
	mix = a[0]
	for i in range(len(a)):
		if mix > a[i]:
			mix = a[i]
			id = i
	return id

def argmax_last(a):
	id = 0
	maz = a[0]
	for i in range(len(a)):
		if maz <= a[i]:
			maz = a[i]
			id = i
	return id

def argmin_last(a):
	id = 0
	mix = a[0]
	for i in range(len(a)):
		if mix >= a[i]:
			mix = a[i]
			id = i
	return id
n = next_int()
s = next_str()
count = 0
for i in range(len(s) - 1):
	if s[i] == s[i + 1]:
		count += 1
print(count)


n = int(input())
m = input()
l = 0
for i in range(n):
	if i + 1 < n and m[i] == m[i + 1]:
		l = l + 1
print(l)


n = int(input())
s = input()
rs = ''
count = 0
count1 = 0
for char in s:
	if count == 0:
		rs = char
		count = 1
	elif char == rs:
		count1 += 1
	rs = char
print(count1)


n = int(input())
s = input()
arr = []
for i in str(s):
	arr.append(i)
count = 0
for i in range(len(arr) - 1):
	if arr[i] == arr[i + 1]:
		count += 1
print(count)


limit = int(input())
string_to_process = input()[0:limit]
first = 0
second = 1
count = 0
while second < len(string_to_process):
	if string_to_process[first] == string_to_process[second]:
		count += 1
	first += 1
	second += 1
print(count)


n = int(input())
s = list(input())
q = 0
f = 1
while True:
	f = 0
	for i in range(len(s) - 1):
		if s[i] == s[i + 1]:
			del s[i]
			f = 1
			break
	if f == 0:
		break
print(n - len(s))


def ii():
	return int(input())

def si():
	return input()

def mi():
	return map(int, input().split())

def li():
	return list(mi())
l = ['a', 'e', 'i', 'o', 'u', 'y', 'A', 'E', 'O', 'I', 'U', 'Y']
n = ii()
s = si()
ans = 0
for i in range(n - 1):
	if s[i] == s[i + 1]:
		ans += 1
	else:
		continue
print(ans)


r_stone = 'RR'
b_stone = 'BB'
g_stone = 'GG'
l = input('')
l = int(l)
x = input('')
count = 0
for i in range(1, l):
	if i >= 1:
		if x[i] == x[i - 1]:
			count += 1
print(count)


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


anzahl = int(input())
farben = input()
farbenlist = list(farben)
i = 0
output = 0
while i != anzahl - 1:
	if farbenlist[i] == farbenlist[i + 1]:
		output += 1
	else:
		pass
	i += 1
print(output)


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


n = int(input())
s = input()
s = list(s[:n])
a = ['a']
for i in s:
	if i == a[-1]:
		continue
	else:
		a.append(i)
del a[0]
print(n - len(a))


import math
N = int(input())
A = input()
count = 1
countlist = []
ans = 0
for i in range(1, N):
	if A[i] != A[i - 1]:
		ans += count - 1
		count = 1
	else:
		count += 1
ans += count - 1
print(ans)


n = int(input())
string = input()
listOfStones = list(string)
counter = 0
previousStone = 'x'
for i in range(len(listOfStones)):
	currentStone = listOfStones[counter]
	if currentStone == previousStone:
		listOfStones.pop(counter)
		continue
	previousStone = currentStone
	counter = counter + 1
newLength = len(listOfStones)
answer = n - newLength
print(answer)


n = int(input())
stones = list(input())
i = 1
k = 0
a = stones[0]
while i <= n - 1:
	if stones[i] == a:
		k += 1
		a = stones[i]
	else:
		a = stones[i]
	i += 1
print(k)


n = int(input())
s = input()
prevBall = ''
newLine = ''
if len(s) == n:
	for i in s:
		if i != prevBall:
			newLine += i
		prevBall = i
print(n - len(newLine))


n = int(input())
stone = str(input())
i = 0
j = 0
while i < n - 1:
	if stone[i] == stone[i + 1]:
		j = j + 1
		i = i + 1
	else:
		i = i + 1
print(str(j))


number = input()
stoun = input()
change = 0
for (i, b) in enumerate(stoun):
	if b == stoun[-1] and i == len(stoun) - 1:
		break
	if stoun[i] == stoun[i + 1]:
		change += 1
print(change)


try:
	N = int(input())
	A = ''
	temp = ''
	count = 0
	A = str(input())
	for i in range(N):
		if temp == A[i]:
			count += 1
		if A[i] == 'R':
			temp = 'R'
		if A[i] == 'G':
			temp = 'G'
		if A[i] == 'B':
			temp = 'B'
	print(count)
except:
	pass


m = int(input())
n = input()
c = 0
i = 0
if len(set(n)) == len(n):
	print('0')
else:
	for x in n:
		if n.index(x) == len(n) - 1:
			break
		elif n[n.index(x)] == n[n.index(x) + 1]:
			c = c + 1
		n = n[n.index(x) + 1:]
	print(c)


length = int(input())
list_s = list(input())
id = 0
counter = 0
while True:
	if id == length - 1:
		break
	if list_s[id] == list_s[id + 1]:
		del list_s[id + 1]
		counter += 1
		length = len(list_s)
	else:
		id += 1
print(counter)


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


x = int(input()) - 1
y = input()
print(sum((y[i] == y[i + 1] for i in range(x))))


n = int(input())
l = list(input())
count = 0
for (i, j) in zip(l[0:], l[1:]):
	if i == j:
		count = count + 1
print(count)


from typing import List
COLORS = List[str]

def solve(*, row: COLORS) -> int:

	def wrapper(*, colors: COLORS, prev: str, count: int) -> int:
		if colors == []:
			return count
		current = colors.pop(0)
		if prev == current:
			return wrapper(colors=colors, prev=prev, count=count + 1)
		return wrapper(colors=colors, prev=current, count=count)
	return wrapper(colors=row, prev=row.pop(0), count=0)
input()
row = list(input())
result = solve(row=row)
print(result)


import math
import os
import random
import re
from sys import stdin, stdout
from collections import Counter
from itertools import permutations

def si():
	return str(stdin.readline())

def ii():
	return int(stdin.readline())

def mi():
	return map(int, stdin.readline().split())

def li():
	return list(mi())

def debug(x):
	return stdout.write(str(x))
n = ii()
s = si()
c = 0
for i in range(n):
	if s[i] == s[i + 1]:
		c += 1
debug(c)


def solve_the_problem():
	stones_nr = int(input())
	colors = input()
	if len(colors) == 1:
		print(0)
		return
	res = colors[0]
	for i in range(1, len(colors)):
		if colors[i - 1] != colors[i]:
			res += colors[i]
	print(len(colors) - len(res))
solve_the_problem()


n_stones = int(input())
colors = input()
f_col = colors[0]
num = 0
for i in range(1, n_stones):
	if colors[i] == f_col:
		num += 1
	else:
		f_col = colors[i]
print(num)


x = int(input())
y = input()
y = y.lower()
s = 0
for i in range(x - 1):
	if y[i] == y[i + 1]:
		s = s + 1
print(s)


n = int(input())
s = str(input())
s = list(s)
i = 0
ans = 0
while i < len(s) - 1:
	if s[i] == s[i + 1]:
		s.remove(s[i + 1])
		ans += 1
	else:
		i += 1
print(ans)


def stone():
	stone_contain = int(input(''))
	stone_string = input('')
	first = stone_string[0]
	count = 0
	for i in range(1, stone_contain):
		if stone_string[i] == first:
			count += 1
		first = stone_string[i]
	return count
print(stone())


a = int(input())
b = input()
wynik = 0
for i in range(0, a - 1):
	if b[i] == b[i + 1]:
		wynik = wynik + 1
	else:
		wynik = wynik
print(wynik)


n = int(input())
st1 = input()
st2 = st1[:1]
for i in range(1, n):
	if st1[i:i + 1] != st2[-1]:
		st2 += st1[i:i + 1]
print(n - len(st2))


n = input()
a = input()
d = len(a)
x = 0
for i in range(0, d - 1, 1):
	if a[i] == a[i + 1]:
		x = x + 1
print(x)


n = int(input())
x = input()
check = [x[i] == x[i + 1] for i in range(n - 1)]
print(sum(check))


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


n = int(input())
st = input()
ls = []
c = 0
for char in st:
	ls.append(char)
z = 0
for x in range(1, len(ls)):
	if ls[x - 1 - z] == ls[x - z]:
		ls.remove(ls[x - z])
		c += 1
		z += 1
print(c)


def solve(s):
	count = 0
	for i in range(1, len(s)):
		if s[i - 1] == s[i]:
			count += 1
	return count
a = input()
s = input()
print(solve(s))


import math as mt
import sys
from collections import *
inf = float('inf')

def ii():
	return int(input())

def mii():
	return map(int, input().split())

def lii():
	return list(map(int, input().split()))

def gmat(n, m):
	return [[0] * m for _ in range(n)]

def imat(n):
	return [list(mii()) for _ in range(n)]
try:
	sys.stdin = open('data\\a.in', 'r')
	input = sys.stdin.readline
except:
	pass
n = ii()
s = input()
k = 0
for i in range(len(s) - 1):
	if s[i] == s[i + 1]:
		k += 1
print(k)


_ = input()
inp = input()
inp = list(inp)
count = 0
for x in range(len(inp) - 1):
	if inp[x] == inp[x + 1]:
		count += 1
print(count)


n = int(input())
num = input()
count = 0
for i in range(n - 1):
	if num[i] == 'R' and num[i + 1] == 'R':
		count += 1
	if num[i] == 'B' and num[i + 1] == 'B':
		count += 1
	if num[i] == 'G' and num[i + 1] == 'G':
		count += 1
print(count)


import math
from sys import stdin, stdout

def get_int():
	return int(stdin.readline().strip())

def get_ints():
	return map(int, stdin.readline().strip().split())

def get_string():
	return stdin.readline().strip()

def get_list():
	return list(map(int, stdin.readline().strip().split()))
n = get_int()
s = get_string()
ans = 0
for i in range(len(s) - 1):
	if s[i] == s[i + 1]:
		ans += 1
stdout.write(str(ans))


import copy

def main():
	n = int(input())
	stones = list(input())
	takes = 0
	for i in range(1, n):
		if stones[i] == stones[i - 1]:
			takes = takes + 1
	print(takes)
main()


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


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


n = int(input())
c = input()
m = list(c)
cnt = 0
for i in range(len(m) - 1):
	if m[i] == m[i + 1]:
		cnt += 1
print(cnt)


length = int(input())
lst = input()
num = 0
for i in range(1, length):
	if lst[i] == lst[i - 1]:
		num += 1
	else:
		continue
print(num)


def countMinStones(n: int, string: str) -> int:
	minStones = 0
	for i in range(1, n):
		if string[i] == string[i - 1]:
			minStones += 1
	return minStones

def main():
	n = int(input().strip())
	string = input().strip()
	print(countMinStones(n, string))
main()


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


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


input()
prev = -1
count = 0
for stone in input():
	if stone == prev:
		count += 1
	prev = stone
print(count)


n = int(input())
s = input()
i = 0
d = 0
while i <= len(s) - 2:
	if s[i] == s[i + 1]:
		d = d + 1
	else:
		pass
	i = i + 1
print(d)


import sys
n = int(sys.stdin.readline())
s = sys.stdin.readline().strip()
mini = 0
Color = ''
for i in range(n):
	currentColor = s[i]
	if currentColor == Color:
		mini += 1
	else:
		Color = currentColor
print(mini)


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


entry = int(input())
seq = input()
sol = ''
for i in range(entry - 1):
	if seq[i] == seq[i + 1]:
		sol += seq[i]
	else:
		continue
print(len(sol))


num = int(input())
colr = list(str(input()).strip())
count = 0
for i in range(num - 1):
	if colr[i] == colr[i + 1]:
		count = count + 1
print(count)


length = int(input())
string = input()
last_letter = string[0]
count = 0
for i in range(1, length):
	letter = string[i]
	if letter == last_letter:
		count += 1
	last_letter = letter
print(count)


k = input()
w = input()
a = w[0]
count = 0
for i in range(len(w) - 1):
	if w[i + 1] == a:
		count = count + 1
	a = w[i + 1]
print(count)


def stones(s, n):
	if n == 0 or n == 1:
		return 0
	smallans = stones(s[1:], n - 1)
	if s[0] == s[1]:
		return smallans + 1
	else:
		return smallans
n = int(input())
s = input()
print(stones(s, n))


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


n = int(input())
arr = input().strip()
pre = arr[0]
num = 0
for i in range(1, n):
	if arr[i] == pre:
		num += 1
	else:
		pre = arr[i]
print(num)


n = int(input())
w = input()
prev = w[0]
ctr = 0
for i in range(1, n):
	if w[i] == prev:
		ctr += 1
	else:
		prev = w[i]
print(ctr)


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


n = int(input(''))
count = 0
s = input('')
l = []
for k in range(0, n):
	l.append(s[k])
for j in range(1, n):
	if l[j] == l[j - 1]:
		count = count + 1
	else:
		count = count
print(count)


n = int(input().rstrip())
s = input()
cnt = 0
prev = s[0]
for i in range(1, n):
	if s[i] == prev:
		cnt += 1
	else:
		prev = s[i]
print(cnt)


length = int(input())
string = list(input())
prev = None
p = 0
for i in string.copy():
	if prev == i:
		string.remove(prev)
		p += 1
	prev = i
print(p)


o = int(input())
s = input()
c = 0
for i in range(o - 1):
	if s[i] != s[i + 1]:
		continue
	else:
		c = c + 1
print(c)


a = input()
b = 0
c = input()
if len(c) == 1:
	print(0)
elif len(c) != 1:
	for i in range(int(a)):
		if i == 0:
			if c[i] == c[i + 1]:
				b = b + 1
		elif i == len(c) - 1:
			if c[i] == c[i - 1]:
				b = b + 1
		elif c[i] == c[i - 1] and c[i] != c[i + 1]:
			b = b + 1
		elif c[i] != c[i - 1] and c[i] == c[i + 1]:
			b = b + 1
		elif c[i] == c[i - 1] and c[i] == c[i + 1]:
			b = b + 2
	print(int(b / 2))


n = int(input())
a = str(input())
b = str()
if n == 1:
	print(0)
else:
	for i in range(0, n - 1):
		if a[i] != a[i + 1]:
			b += a[i]
		if i == n - 2:
			b += a[i + 1]
	print(len(a) - len(b))


n = int(input())
s = str(input())
p = 0
count = 0
while p < n - 1:
	curr = s[p]
	pp = p + 1
	while curr == s[pp]:
		count += 1
		pp += 1
		if pp > n - 1:
			break
	p = pp
print(count)


n = int(input())
s = input()
prev = ''
unique = 0
for i in range(len(s)):
	if prev != s[i]:
		unique += 1
	prev = s[i]
print(len(s) - unique)


s = input()
p = input()
a = []
for i in range(len(p) - 1):
	if p[i] == p[i + 1]:
		a.append(p[i])
print(len(a))


N = int(input())
S = input()
i = 0
count = 0
while i < N:
	p = S[i]
	j = i + 1
	while j < N:
		if S[j] != p:
			break
		j = j + 1
	count = count + (j - i - 1)
	i = j
print(count)


num = int(input())
string = input()
i = 1
while i < len(string):
	if string[i] == string[i - 1]:
		if i != len(string) - 1:
			string = string[:i] + string[i + 1:]
		else:
			string = string[:i]
	else:
		i += 1
print(num - len(string))


n = int(input())
s = input()
l = []
for i in s:
	try:
		if i != l[len(l) - 1]:
			l.append(i)
	except:
		l.append(i)
print(n - len(l))


def p_count(arr, n):
	count = 0
	for i in range(n - 1):
		if arr[i] == arr[i + 1]:
			count += 1
	return count
l = int(input())
arr = input().upper()
n = len(arr)
print(p_count(arr, n))


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


_ = input()
ip = input()
removals = 0
List = list(ip)
i = 1
while i < len(List):
	if List[i] == List[i - 1]:
		List.pop(i)
		removals += 1
	else:
		i += 1
print(removals)


x = int(input())
str = input()
m = 0
n = 0
for i in str[0:x - 1]:
	if str[m] == str[m + 1]:
		n += 1
	m += 1
print(n)


count = 0
b = int(input())
a = input()
if len(a) == b:
	if b >= 1 and b <= 50:
		for i in range(len(a) - 1):
			if a[i] == a[i + 1]:
				count = count + 1
print(count)


n = int(input())
string = list(input())
length = len(string) - 1
count = 0
i = 1
while i <= len(string) - 1:
	if string[i] == string[i - 1]:
		count += 1
		string.pop(i)
		continue
	i += 1
print(count)


n = input()
s = input()
prev = ' '
cnt = 0
for c in s:
	if c == prev:
		cnt += 1
	prev = c
print(cnt)


n = int(input())
s = str(input())
A = list(s)
c = 0
i = 0
while len(A) >= 2:
	if A[i] == A[i + 1]:
		A.remove(A[i])
		c += 1
		i = i
	else:
		i += 1
	if i == len(A) - 1:
		break
print(c)


N = int(input())
word = input()
ans = 0
for i in range(N - 1):
	if word[i] == word[i + 1]:
		ans += 1
print(ans)


t = int(input())
s = input()
s = list(s)
c = 0
if s.count(s[0]) != t:
	for i in range(t - 1):
		if s[i] == s[i + 1]:
			c = c + 1
	print(c)
else:
	print(t - 1)


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


line = input()
count = 0
while True:
	try:
		line = input()
		line = list(line)
		for i in range(len(line)):
			if i != len(line) - 1:
				if line[i] == line[i + 1]:
					count += 1
	except EOFError:
		break
print(count)


n = input()
s = input()
from itertools import groupby
res = 0
for (k, g) in groupby(s):
	lg = len(list(g))
	if lg > 1:
		res += lg - 1
print(res)


y = int(input())
a = input()
k = 0
for i in range(1, y):
	if a[i - 1] == a[i]:
		k += 1
print(k)


n = int(input())
k = input()
l = list(k)
i = 0
c = 0
for j in range(i + 1, n):
	if l[i] == l[j]:
		c += 1
	i += 1
print(c)


input_number = input()
input_stones = input()
temp_string = ''
move = 0
for character in input_stones:
	if temp_string == character:
		move = move + 1
	temp_string = character
print(move)


n = int(input())
s = input()
stones = list(s)
i = 0
qtd = 0
while i <= n - 2:
	if stones[i] == stones[i + 1]:
		qtd = qtd + 1
	i = i + 1
print(qtd)


n = int(input())
l = list(input())
i = 0
repeat = 0
while i < len(l) - 1:
	if l[i] == l[i + 1]:
		repeat += 1
		l.pop(i + 1)
	else:
		i += 1
print(repeat)


n = input()
s = input()
count = 0
for i in range(len(s) - 1):
	if s[i:i + 2] == 'RR' or s[i:i + 2] == 'GG' or s[i:i + 2] == 'BB':
		count += 1
print(count)


x = input()
y = input()
seq = list(y)
mem = ''
steps = 0
loopCounter = 1
for i in seq:
	if i == mem:
		steps += 1
	mem = i
	if loopCounter == len(seq):
		print(steps)
		break
	loopCounter += 1


numOfStones = int(input())
stoneColor = input()
count = 0
for i in range(1, numOfStones):
	if stoneColor[i] == stoneColor[i - 1]:
		count += 1
print(count)


class Stones:

	@staticmethod
	def solve(n, stones):
		count = 0
		for i in range(1, n):
			if stones[i] == stones[i - 1]:
				count += 1
		return count

def main():
	num_of_stones = int(input())
	stones = input()
	s = Stones()
	print(s.solve(num_of_stones, stones))
main()


n = int(input())
a = input()
counter = 0
i = 0
while i < n:
	count = 0
	for j in range(i + 1, n):
		if a[i] != a[j]:
			break
		count = count + 1
	counter = counter + count
	i = i + count + 1
print(counter)


n = int(input())
color = str(input())
i = 0
stone = []
while i < len(color) - 1:
	if color[i] == color[i + 1]:
		stone.append(color[i])
	i = i + 1
print(len(stone))


P = int(input())
T = input()
count = 0
for i in range(1, len(T)):
	if T[i] == T[i - 1]:
		count += 1
print(count)


z = input()
x = input()
y = list(x)
i = 0
x = 0
while i < len(y) - 1:
	if y[i] == y[i + 1]:
		x += 1
	i += 1
print(x)


n = int(input())
w = input()
c = 0
c2 = ''
for i in w:
	c3 = i
	if c3 == c2:
		c += 1
		c2 = c3
	else:
		c2 = c3
print(c)


(_, s) = (input(), input())
k = 'RBG'
x = s
for _ in range(50):
	for c in k:
		x = x.replace(2 * c, c)
print(len(s) - len(x))


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


s = int(input())
k = str(input())
l = list(k)
count = 0
i = 0
while i < len(l):
	if i + 1 == len(l):
		break
	elif l[i] == l[i + 1]:
		l.pop(i)
		count = count + 1
	else:
		i = i + 1
print(count)


from sys import stdin, stdout
take = 0
n = int(stdin.readline())
s = stdin.readline()
for i in range(1, len(s)):
	if s[i] == s[i - 1]:
		take += 1
stdout.write('%d\n' % take)


d = input()
a = input()
b = 0
c = a[0]
for k in range(1, len(a)):
	if a[k] == c:
		b += 1
	else:
		c = a[k]
print(b)


n = int(input())
s = input()
ans = 1
for (a, b) in zip(s[:-1], s[1:]):
	ans += 1 if a != b else 0
print(n - ans)


a = int(input())
s = str(input())
count = 0
for b in range(a - 1):
	if s[b] == s[b + 1]:
		count += 1
print(count)


n = int(input())
count = 0
s = input()
curcount = s.count('RR') + s.count('GG') + s.count('BB')
count += curcount
while curcount != 0:
	s = s.replace('RR', ' R')
	s = s.replace('GG', ' G')
	s = s.replace('BB', ' B')
	s = s.replace(' ', '')
	curcount = s.count('RR') + s.count('GG') + s.count('BB')
	count += curcount
print(count)


num = input()
stones = input()
cnt = 0
for (i, stone) in enumerate(stones[1:]):
	if stone == stones[i]:
		cnt += 1
print(cnt)


n = int(input())
s = input()
h = 0
while 'RR' in s or 'GG' in s or 'BB' in s:
	for i in ['RR', 'GG', 'BB']:
		if i in s:
			h += s.count(i)
			s = s.replace(i, i[1])
print(h)


n = int(input())
str = input()
k = 0
for i in range(len(str) - 1):
	if str[i] == str[i + 1]:
		str.replace(str[i], '')
		k += 1
print(k)


def main():
	n = int(input())
	stones = input().strip()
	record = list()
	for s in stones:
		if record and record[-1][0] == s:
			record[-1][1] += 1
		else:
			record.append([s, 0])
	print(sum([x[1] for x in record]))
main()


def CountNbrStone(s):
	if len(s) == 1:
		return 0
	count = 0
	i = 1
	last_i = 0
	while i < len(s):
		if s[i] == s[last_i]:
			count += 1
		else:
			last_i = i
		i += 1
	return count
l = int(input())
s = input()
print(CountNbrStone(s))


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


n = int(input())
a = str(input())
count = 0
for (i, j) in zip(a, a[1:]):
	if i == j:
		count += 1
print(count)


def co(a, n):
	p1 = 0
	p2 = 1
	c = 0
	while p2 < n:
		if a[p1] == a[p2]:
			c += 1
		else:
			p1 = p2
		p2 += 1
	return c
n = int(input())
s = input()
print(co(s, n))


colors_num = int(input(''))
colors = input('')
neighbours = 0
previous_color = 'N'
for color in colors:
	if previous_color == color:
		neighbours += 1
		previous_color = color
	else:
		previous_color = color
print(neighbours)


(n, s) = (int(input()), input())
for ch in 'RGB':
	while ch * 2 in s:
		s = s.replace(ch * 2, ch)
print(n - len(s))


n = eval(input())
col = input()
j = 0
for i in range(n - 1):
	if col[i] == col[i + 1]:
		j = j + 1
print(j)


import sys
input = sys.stdin.readline

def inp():
	return int(input())

def inlt():
	return list(map(int, input().split()))

def insr():
	s = input()
	return list(s[:len(s) - 1])

def invr():
	return map(int, input().split())
n = inp()
s = insr()
count = 0
for (i, j) in zip(s[1:], s):
	if i == j:
		count += 1
print(count)


n = int(input())
colors = input()
strike_color = 'any-non-existent-color'
strike_len = 0
count = 0
stones_to_remove = 0
while count < len(colors):
	stone = colors[count]
	count = count + 1
	if strike_color == stone:
		strike_len = strike_len + 1
	else:
		stones_to_remove += strike_len
		strike_color = stone
		strike_len = 0
print(stones_to_remove + strike_len)


class Solution:

	def solve(self, string):
		sameCount = 1
		n = len(string)
		ans = 0
		for i in range(1, n):
			if string[i] == string[i - 1]:
				sameCount += 1
			else:
				sameCount = 1
			ans += 1 if sameCount - 1 > 0 else 0
		return ans
sol = Solution()
n = int(input().strip())
string = input().strip()
print(sol.solve(string))


null = int(input())
num = input()
lst = []
for i in range(len(num)):
	if i != 0:
		if num[i - 1] != num[i]:
			lst.append(num[i])
	if i == 0:
		lst.append(num[0])
print(len(num) - len(lst))


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


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


(_, stones) = (input(), input())
previous = ''
to_remove = 0
for current in stones:
	if current == previous:
		to_remove += 1
	previous = current
print(to_remove)


import itertools
n = int(input())
c = 0
for (x, y) in itertools.groupby(str(input())):
	c += len(list(y)) - 1
print(c)


n = int(input())
l = list(input())
c = 0
for i in range(1, len(l)):
	if l[i - 1] == l[i]:
		c = c + 1
if c == n:
	print(n - 1)
else:
	print(c)


input()
s = input()
reps = 0
last = s[0]
for c in s[1:]:
	if c == last:
		reps += 1
	last = c
print(reps)


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


def main():
	total_stones = int(input())
	stones = input()
	total_removed_stones = 0
	for i in range(total_stones - 1):
		if stones[i] == stones[i + 1]:
			total_removed_stones += 1
	print(total_removed_stones)
main()


m = int(input())
s = input()
k = s[0]
a = 0
for i in range(1, m):
	if s[i] == k:
		a = a + 1
	k = s[i]
print(a)


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


n = int(input())
string = input()
ar = []
count = 0
for i in range(len(string)):
	ar.append(string[i])
for i in range(1, len(ar)):
	if ar[i - 1] == ar[i]:
		count += 1
print(count)


n = int(input())
s = list(input())
removeCount = 0
index = 0
while index < len(s) - 1:
	if s[index] == s[index + 1]:
		s.pop(index)
		removeCount += 1
	else:
		index += 1
print(removeCount)


count = int(input())
stones = input()

def filter(array):
	if array == []:
		return []
	result = [array[0]]
	for i in range(1, len(array)):
		if array[i] == result[-1]:
			continue
		result.append(array[i])
	return result
res = filter(stones)
print(len(stones) - len(res))


n = int(input())
z = list(map(str, input()))
x = 0
for i in range(n - 1):
	if z[i] == z[i + 1]:
		x += 1
print(x)


n = int(input())
word = input()
out = ''
for i in range(n - 1):
	if word[i] == word[i + 1]:
		out = out + word[i]
	else:
		out = out
print(len(out))


a = int(input())
b = input()
x = 0
y = 0
while 1 <= a <= 50 and x < a - 1:
	if str(b[x]) == str(b[x + 1]):
		y = y + 1
		x = x + 1
	elif str(b[x]) != str(b[x + 1]):
		x = x + 1
print(y)


t = int(input())
n = input()
l = [n[0]]
j = 0
for i in range(1, len(n)):
	if l[j] != n[i]:
		l.append(n[i])
		j += 1
print(t - len(l))


count_stones = input()
stones_on_table = input()
temp = ''
count = 0
for i in range(int(count_stones)):
	if not temp:
		temp = stones_on_table[i]
	else:
		if temp == stones_on_table[i]:
			count += 1
		temp = stones_on_table[i]
print(count)


a = input()
aa = int(a)
z = aa - 1
bb = input()
d = list()
r = 0
for sp in bb:
	d.append(sp)
i = 0
for s in d:
	i = i + 1
	if i == len(d):
		break
	if d[i - 1] == d[i]:
		d[i - 1] = None
		r = r + 1
	else:
		continue
print(r)


n = int(input())
strng = input()
res = 0
prev = 'Z'
i = 0
while i < n:
	while i < n and prev == strng[i]:
		res += 1
		i += 1
	if i >= n:
		break
	prev = strng[i]
	i += 1
print(res)


n = int(input())
arr = input()
if n < 2:
	print('0')
	quit()
c = 0
for i in range(1, n):
	if arr[i - 1] == arr[i]:
		c += 1
print(c)


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


def main():
	n = int(input())
	mas = list(map(str, input()))
	count = 0
	if 1 <= n and n <= 50:
		if len(mas) == n:
			for i in range(0, len(mas) - 1):
				if mas[i] == mas[i + 1]:
					mas.append(mas[i])
					count += 1
	print(count)
main()


import sys
n = int(input())
b = input()
resp = 0
for i in range(1, n):
	if b[i] == b[i - 1]:
		resp += 1
print(resp)


import math
L = lambda : list(map(int, input().split()))
M = lambda : map(int, input().split())
I = lambda : int(input())
IN = lambda : input()

def s(a):
	print(''.join(list(map(str, a))))
n = I()
a = IN()
x = 0
for i in range(n - 1):
	if a[i] == a[i + 1]:
		x += 1
print(x)


n = int(input())
s = list(input())
previous = ''
ans = 0
for (index, element) in enumerate(s):
	if element == previous:
		ans += 1
	previous = element
print(ans)


y = int(input())
x = input()
i = 0
a = 0
f = False
while i < len(x) - 1:
	if x[i] == x[i + 1]:
		a += 1
	i += 1
print(a)


(n, a) = (int(input()), input())
currval = a[0]
c = 1
for i in a:
	if i == currval:
		continue
	else:
		currval = i
		c -= -1
print(n - c)


numOfStones = input()
stones = input()
currentLetter = ''
dupCount = 0
for stone in stones:
	if currentLetter == stone:
		dupCount += 1
	else:
		currentLetter = stone
print(dupCount)


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


number = input()
line = input()
counter = 0
prev = line[0]
for s in line[1:]:
	if s == prev:
		counter += 1
	prev = s
print(counter)


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


TN = 1

def solution():
	n = int(input())
	a = list(input())
	ans = 0
	for i in range(1, n):
		if a[i] == a[i - 1]:
			ans += 1
	print(ans)
while TN != 0:
	solution()
	TN -= 1


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


n = int(input())
seq = input()
cont = 0
for x in range(0, len(seq) - 1):
	if seq[x] == seq[x + 1]:
		cont += 1
print(cont)


n = int(input())
string = list(input())
string.append('z')
count = 0
answer = 0
for i in range(1, n + 1):
	if string[i] == string[i - 1]:
		count = count + 1
	if string[i] != string[i - 1]:
		answer = answer + count
		count = 0
print(answer)


n = int(input())
n1 = input()
lst = []
s = n1[:n]
w = 0
for i in s:
	lst.append(i)
for j in range(len(lst) - 1):
	if lst[j] == lst[j + 1]:
		w = w + 1
print(w)


input()
s = input() + 'O'
p = 0
Q = s[0]
sh = 0
for i in s:
	if i == Q:
		p += 1
	else:
		sh += p - 1
		p = 1
		Q = i
print(sh)


n = int(input())
m = input()
num = 0
f = m[0]
for i in range(1, n):
	if m[i] == f:
		num += 1
	else:
		f = m[i]
print(num)


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


_ = input()
S = input()
prev = None
count = 0
for c in S:
	if prev and prev == c:
		count += 1
	prev = c
print(count)


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


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


no_of_stones = input()
colour_of_stones = input()
l = ['R', 'G', 'B']
empty_str = ''
empty = ''
x = 0
firstCounter = 0
secondCounter = 1
while secondCounter < len(colour_of_stones):
	if colour_of_stones[firstCounter] == colour_of_stones[secondCounter]:
		for element in l:
			if element != colour_of_stones[firstCounter]:
				empty_str += colour_of_stones[firstCounter]
				empty_str += element
				break
		empty = empty_str
		empty_str += colour_of_stones[secondCounter:]
		colour_of_stones = empty_str
		empty_str = empty
		empty = ''
		firstCounter = secondCounter
		secondCounter += 1
		x += 1
	else:
		firstCounter += 1
		secondCounter += 1
		empty_str = colour_of_stones[0:secondCounter]
print(x)


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


try:
	t = int(input())
	s = list(input())
	count = 0
	for i in range(0, t - 1):
		if s[i] == s[i + 1]:
			count += 1
	print(count)
except:
	pass


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


n = int(input())
s = input()
t = 0

def f(s):
	for i in range(len(s) - 1):
		if s[i] == s[i + 1]:
			return False
	return True
i = 0
while not f(s) and len(s) > 1:
	if s[i] == s[i + 1]:
		s = s[:i] + s[i + 1:]
		t += 1
		i = 0
	else:
		i += 1
print(t)


input()
s = 'W' + input() + 'W'
ans = 0
i = 0
while i < len(s):
	for j in range(i + 1, len(s)):
		if s[i] == s[j]:
			ans += 1
			i = j
		else:
			break
	i += 1
print(ans)


inputS = input()
inputL = input()
f2 = 0
f = ''
for x in inputL:
	if f == x:
		f2 += 1
	f = x
print(f2)


inp = int(input())
s = list(str(input()))
count = 0
for x in range(inp - 1):
	if s[x] == s[x + 1]:
		count += 1
print(count)


z = input
z()
a = z()
last = 'n'
count = 0
for value in a:
	if last != value:
		count += 1
		last = value
print(len(a) - count)


useless = input()
string = str(input())
stones = 0
swaps_per = 0
i = 1
while True:
	if i < len(string):
		if string[i] == string[i - 1]:
			string = string[:i - 1] + string[i:]
			stones += 1
			swaps_per += 1
		i += 1
	elif swaps_per != 0:
		i = 1
		swaps_per = 0
	else:
		break
print(stones)


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


n = int(input())
string = input()
output = 0
for i in range(n):
	if i == n - 1:
		break
	if string[i] == 'R':
		if string[i + 1] == 'R':
			output += 1
	if string[i] == 'G':
		if string[i + 1] == 'G':
			output += 1
	if string[i] == 'B':
		if string[i + 1] == 'B':
			output += 1
print(output)


N = int(input())
S = input()
print(sum((1 for i in range(N - 1) if S[i] == S[i + 1])))


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


n = int(input())
st = input()
c = 0
i = 1
while i < n:
	while st[i] == st[i - 1] and i < n:
		c = c + 1
		i = i + 1
		if i >= n:
			break
	i = i + 1
print(c)


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


n = int(input())
s = input().strip()
i = 1
count = 0
while i < n:
	if s[i] != s[i - 1]:
		i += 1
		pass
	elif i != n - 1:
		s = s[:i] + s[i + 1:]
		count += 1
		n -= 1
	else:
		count += 1
		break
print(count)


def main():
	n = int(input())
	colors = list(input())
	stones = 0
	for c in range(len(colors) - 1):
		if colors[c] == colors[c + 1]:
			stones += 1
	print(stones)
main()


def Substring(s):
	(ans, temp) = (0, 0)
	for i in s:
		ans += i == temp
		temp = i
	return ans
(input(), print(Substring(input())))


s = open(0).read().split()[1]
(c, m) = (s[0], 0)
for i in s[1:]:
	if i == c:
		m += 1
	else:
		c = i
print(m)


n = int(input())
string = input('')

def removeSimilarStones(string, i):
	if string[i] == string[i + 1]:
		string = string[0:i] + string[i + 1:len(string)]

def minimum_count(n: int, string):
	new_String = ''
	if n <= 1:
		return 0
	else:
		for i in range(0, len(string) - 1):
			if string[i] != string[i + 1]:
				new_String = new_String + string[i]
	if len(new_String) != 0:
		if string[-1] != new_String[-1]:
			new_String = new_String + string[-1]
			min_count = abs(len(string) - len(new_String))
	else:
		min_count = len(string) - 1
	return min_count
print(minimum_count(n, string))


n = int(input())
stones = input()
resultant = []
count = 0
c = 0
resultant.append(stones[0])
for i in range(1, n):
	if stones[i] == resultant[c]:
		count += 1
	else:
		c += 1
		resultant.append(stones[i])
print(count)


N = int(input(''))
D = input('')
Cont = 0
ND = []
for J in range(N + 1):
	if J < N:
		ND = ND + [D[J]]
	else:
		ND = ND + ['', 'q']
for K in range(N + 1):
	if K < N + 1:
		if ND[K] == ND[K + 1]:
			Cont = Cont + 1
	else:
		break
print(Cont)


input()
a = input()
curr = a[0]
ret = 0
for i in a[1:]:
	if curr == i:
		ret += 1
	else:
		curr = i
print(ret)


n = int(input())
x = input()
l = []
c = 0
for i in x:
	if l:
		l.append(i)
		if i == y:
			c += 1
			y = i
		else:
			y = i
			continue
	else:
		l.append(i)
		y = i
print(c)


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


n = int(input())
s = input()
l1 = list((str(x) for x in s))
l2 = []
c = 1
deletes = 0
while c != 0:
	i = 0
	c = 0
	l2 = []
	while i < len(l1) - 1:
		if l1[i] == l1[i + 1]:
			l2.append(l1[i])
			deletes += 1
			i += 2
			c += 1
		else:
			l2.append(l1[i])
			i += 1
	if i == len(l1) - 1:
		l2.append(l1[i])
	l1 = l2
print(deletes)


num = int(input())
colors = input()
i = 0
count = 0
for x in colors:
	if i == 0:
		temp = x
		i += 1
		continue
	if x == temp:
		count += 1
	else:
		temp = x
print(count)


input()
x = input()
count = 0
for i in range(0, len(x) - 1):
	if x[i] == 'R' and x[i + 1] == 'R':
		count += 1
	elif x[i] == 'G' and x[i + 1] == 'G':
		count += 1
	elif x[i] == 'B' and x[i + 1] == 'B':
		count += 1
print(count)


leng = input()
n = input()
l = []
mat = [i for i in n]
count = 1
while count > 0:
	count = 0
	for i in range(0, len(mat) - 2):
		if mat[i] == mat[i + 1]:
			count += 1
			l.append(1)
			del mat[i + 1]
			break
if len(mat) > 1:
	if mat[len(mat) - 1] == mat[len(mat) - 2]:
		l.append(1)
print(len(l))


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


n = input()
s = input()
arr = [letter for letter in s]
i = 0
counter = 0
while i < len(arr) - 1:
	if arr[i] == arr[i + 1]:
		arr.pop(i)
		counter += 1
		continue
	else:
		pass
	i += 1
print(counter)


i = input()
j = input()
count = 0
for k in range(len(j) - 1):
	if j[k] == j[k + 1]:
		count += 1
print(count)


t = int(input())
h = input()
ouns = 0
for i in range(t):
	if i == 0:
		q = 1
	elif h[i] == h[i - 1]:
		ouns += 1
print(ouns)


rocks = int(input())
seq = input()
removals = 0
while 'BB' in seq:
	seq = seq.replace('BB', 'B', 1)
	removals += 1
while 'RR' in seq:
	seq = seq.replace('RR', 'R', 1)
	removals += 1
while 'GG' in seq:
	seq = seq.replace('GG', 'G', 1)
	removals += 1
print(removals)


def solve(a):
	counter = 0
	for i in range(1, len(a)):
		if a[i] == a[i - 1]:
			counter += 1
	print(counter)
h = input()
a = input()
solve(a)


a = int(input())
b1 = input()[:a]
count = 0
b = []
for i in range(len(b1) - 1):
	if b1[i] == b1[i + 1]:
		count = count + 1
		b.append(count)
	else:
		continue
if len(b) >= 1:
	print(b[-1])
else:
	print(0)


def main():
	n = input()
	s = str(input())
	r = []
	c = 0
	for i in s:
		if len(r) != 0:
			if r[-1] == i:
				c += 1
			r.append(i)
		r.append(i)
	print(c)
main()


size = input()
stones = input()
final = []
for i in range(len(stones)):
	final.append(stones[i])
for i in range(len(stones) - 1):
	if stones[i] == stones[i + 1]:
		final.remove(stones[i])
print(len(stones) - len(final))


bleh = input()
s = input()
c = ''
n = 0
for x in s:
	if c == x:
		n += 1
	c = x
print(n)


x = input()
stoneNum = int(x)
str = input()
taken = 0

def return_value(new_str, x):
	x = int(x)
	result = False
	if len(new_str) != x or x == 1:
		result = False
	else:
		for i in range(len(new_str)):
			if new_str[i] not in 'RGB':
				result = False
				break
		else:
			result = True
	return result
if return_value(str, stoneNum):
	for i in range(len(str) - 1):
		if str[i] == str[i + 1]:
			taken += 1
else:
	taken = 0
print(taken)


n = int(input())
pierre = input() + 'A'
output = 0
for i in range(n):
	if pierre[i] == pierre[i + 1]:
		output += 1
print(output)


s = input()
stones = list(input())
for i in range(len(stones) - 1):
	if stones[i] == stones[i + 1]:
		stones[i] = 'D'
print(stones.count('D'))


n = int(input())
stones = input()
lastStone = '0'
differentStoneCount = 0
for e in stones:
	if e != lastStone:
		differentStoneCount += 1
		lastStone = e
print(n - differentStoneCount)


n = input()
s = input()
current = 'A'
counter = 0
for i in range(0, int(n)):
	if current == s[i]:
		counter = counter + 1
	current = s[i]
print(str(counter))


n = int(input())
stones = list(str(input()))
min_number = 0
for i in range(len(stones) - 1):
	if stones[i] == stones[i + 1]:
		min_number += 1
print(min_number)


number_of_stone = int(input())
stone_list = str(input())
counter = 0
for i in range(len(stone_list) - 1):
	if stone_list[i] == stone_list[i + 1]:
		flag = stone_list[i]
		counter += 1
print(counter)


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


x = int(input(''))
y = input('')
z = 0
for c in range(x):
	if len(y) == c + 1:
		break
	if y[c] == y[c + 1]:
		z = z + 1
print(z)


def mini(s1, n):
	l = []
	l = list(s1)
	i = 0
	c = 0
	for i in range(n - 1):
		if l[i] == l[i + 1]:
			c = c + 1
	print(c)
t = int(input())
s = input()
mini(s, t)


n = int(input())
x = list(input())
c = 0
a = 0
ans = 0
for i in x:
	if i != a:
		c = 0
		a = i
	else:
		c += 1
		if c >= 1:
			ans += 1
print(ans)


n = int(input())
c = list(input())
o = 0
for x in range(n - 1):
	if c[x + 1] == c[x]:
		o += 1
	else:
		continue
print(o)


input()
s = input()
count = 0
for (k, v) in enumerate(s):
	if k == 0:
		continue
	if s[k] == s[k - 1]:
		count += 1
print(count)


b = 0
r = 0
g = 0
c = 0
n = input()
s = input()
for i in s:
	if i == 'R':
		r += 1
		b = 0
		g = 0
		if r >= 2:
			c += 1
	if i == 'G':
		g += 1
		r = 0
		b = 0
		if g >= 2:
			c += 1
	if i == 'B':
		b += 1
		r = 0
		g = 0
		if b >= 2:
			c += 1
print(c)


a = input()
a = input()
a = list(a)
counter = 0
i = 0
while i + 1 < len(a):
	if a[i] == a[i + 1]:
		counter += 1
	i += 1
print(str(counter))


n = int(input())
colors = input()
i = 0
p = 0
while i < n:
	if i + 1 != n:
		if colors[i] == colors[i + 1]:
			p += 1
	i += 1
print(p)


numofstones = int(input())
s = input()
numofequalneigbors = 0
for i in range(len(s) - 1):
	if s[i] == s[i + 1]:
		numofequalneigbors += 1
print(numofequalneigbors)


n = int(input())
s = input()
ma = 0
d = {'R': 0, 'G': 0, 'B': 0}
d[s[0]] += 1
for i in range(1, n):
	if s[i - 1] == s[i]:
		d[s[i - 1]] += 1
	else:
		ma += d[s[i - 1]] - 1
		d[s[i - 1]] = 0
		d[s[i]] = 1
if n == 1:
	print(0)
else:
	if s[-2] == s[-1]:
		ma += d[s[-1]] - 1
	print(ma)


length = int(input())
str1 = input()
count = 0
if len(set(str1)) == 1:
	print(len(str1) - 1)
else:
	for i in range(len(str1) - 1):
		list1 = str1[i:i + 2]
		if len(set(list1)) == 1:
			count = count + 1
		else:
			continue
	print(count)


noOfStones = int(input())
color = str(input())
count = 0
for i in range(noOfStones - 1):
	if color[i] == color[i + 1]:
		count += 1
print(count)


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


length = int(input())
ip = input()
s = ip[0]
count = 0
for i in range(1, length):
	if ip[i] == s:
		count += 1
	else:
		s = ip[i]
print(count)


numStones = int(input())
stones = input()
count = 0
i = 0
for color in stones:
	if i < numStones - 1:
		if color == stones[i + 1]:
			count = count + 1
	i = i + 1
print(count)


i_nmb = int(input())
i_str = input()
del_action = 0
z = ''
for i in range(0, i_nmb):
	if i_str[i] != z:
		z = i_str[i]
	else:
		del_action += 1
print(del_action)


import sys
input = sys.stdin.readline
n = int(input())
stones = input()
to_remove = 0
for i in range(n - 1):
	if stones[i] == stones[i + 1]:
		to_remove += 1
print(to_remove)


n = int(input())
a = input()
L = list(a)
b = 0
for i in range(len(L) - 1):
	if L[i] == L[i + 1]:
		b += 1
print(b)


n = int(input())
s = input()
if len(set(s)) == 1:
	print(len(s) - 1)
else:
	c = 0
	i = 1
	a = list(s)
	while i < len(a):
		if a[i] == a[i - 1]:
			a.pop(i)
			c += 1
			i = 1
		else:
			i += 1
	print(c)


def removeCount(stones):
	if len(stones) == 1:
		return 0
	if len(stones) == 2:
		if stones[0] == stones[1]:
			return 1
		else:
			return 0
	for i in range(1, len(stones)):
		if stones[i] == stones[i - 1]:
			return 1 + removeCount(stones[:i] + stones[i + 1:])
	return 0

def main():
	n = int(input())
	stones = input()
	print(removeCount(stones))
main()


n = input()
str1 = input()
str_R = str1.replace('G', 'B')
str_G = str1.replace('R', 'B')
str_B = str1.replace('G', 'R')
list_R = str_R.split('B')
list_G = str_G.split('B')
list_B = str_B.split('R')
while '' in list_R:
	list_R.remove('')
while '' in list_G:
	list_G.remove('')
while '' in list_B:
	list_B.remove('')
sum_R = 0
sum_G = 0
sum_B = 0
for r in list_R:
	sum_R = sum_R + len(r) - 1
for g in list_G:
	sum_G = sum_G + len(g) - 1
for b in list_B:
	sum_B = sum_B + len(b) - 1
print(sum_R + sum_G + sum_B)


x = eval(input())
ch = input()
s = 0
for i in range(x - 1):
	if ch[i] == ch[i + 1]:
		s += 1
print(s)


n = input()
s = list(input())
(c, x) = (0, 'A')
for i in s:
	if i == x:
		c += 1
	x = i
print(c)


def solve(n, stones):
	changes = 0
	for i in range(1, n):
		if stones[i] == stones[i - 1]:
			changes += 1
	return changes
numberStones = int(input())
colorStones = input().upper()
print(solve(numberStones, colorStones))


n = int(input())
s = input()
s = list(s)
r = 0
lim = len(s)
i = 0
while i < lim - 1:
	if s[i] == s[i + 1]:
		del s[i + 1]
		lim = lim - 1
		r = r + 1
	else:
		i = i + 1
print(r)


length = int(input())
stones = list(input())
counter = 0
i = 0
while i < len(stones) - 1:
	if stones[i] == stones[i + 1]:
		stones.pop(i + 1)
		counter += 1
		i -= 1
	i += 1
print(counter)


a = int(input(''))
lt = list(input())

def split(word):
	return (al for al in word)
j = 0
flag = 0
split(lt)
while j < a - 1:
	if lt[j] == lt[j + 1]:
		flag += 1
	j = j + 1
print(flag)


def f(x):
	if x == 'B':
		return 1
	elif x == 'R':
		return 2
	else:
		return 3
a = input()
b = input()
c = 0
for i in range(1, int(a)):
	if f(b[i]) == f(b[i - 1]):
		c += 1
print(c)


n = int(input())
col = input()
prev = None
count = 0
for i in col:
	if prev == i:
		count += 1
	else:
		prev = i
print(count)


elem = int(input())
string = input()
count = 0
curr = string[0]
for x in range(1, len(string)):
	if string[x] == curr:
		count = count + 1
	else:
		curr = string[x]
print(count)


def unique(l, n):
	r = [l[0]]
	r.extend([l[i] for i in range(1, n) if l[i] != l[i - 1]])
	return r
n = int(input().strip())
s = unique(input().strip(), n)
print(n - len(s))


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


n = int(input())
string = input()
count = 0
i = 0
while i < n:
	try:
		if string[i] == string[i + 1]:
			count += 1
	except IndexError:
		pass
	i += 1
print(count)


input()
num = 0
a = ''
for i in input():
	if a == '':
		a = i
		continue
	if a == i:
		num += 1
	else:
		a = i
print(num)


input()
s = input()
c = 0
oldl = s[0]
for l in s[1:]:
	c += 1 if oldl == l else 0
	oldl = l
print(c)


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


n_stones = int(input())
stones = input().strip()
prev = 'X'
delete = 0
for stone in stones:
	if stone == prev:
		delete += 1
	else:
		prev = stone
print(delete)


n = input()
n = int(n)
colours = input()
colours = list(colours)
removed = []
for i in range(n - 1):
	if colours[i] != colours[i + 1]:
		removed = removed + [colours[i]]
length = len(colours)
removed = removed + [colours[length - 1]]
print(n - len(removed))


n = int(input())
c = -1
s = input()
ch = s[0]
for cha in s:
	if cha == ch:
		c += 1
	ch = cha
print(c)


a = int(input())
b = input()
cn = 0
d = 0
for i in range(a - 1):
	if b[cn] == b[cn + 1]:
		d += 1
	cn += 1
print(d)


n = int(input())
s = input()
count = 0
min_temp = 0
first = s[0]
for second in range(1, len(s)):
	if s[second] == first:
		min_temp += 1
	else:
		first = s[second]
print(min_temp)


nums = input().split(' ')
nums = int(nums[0])
strs = input()
sums = 0
for i in range(nums - 1):
	if strs[i] == strs[i + 1]:
		sums += 1
print(sums)


g = int(input())
s = input()
j = list(s)
count = 0
for i in range(0, len(j) - 1):
	if j[i] == 'R' or j[i] == 'B' or j[i] == 'G':
		if j[i] == j[i + 1]:
			count = count + 1
print(count)


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


import re
n = int(input())
stones = input()
colors = ['RR', 'GG', 'BB']
out = 0
for i in colors:
	out += len(re.findall('(?={})'.format(i), stones))
print(out)


def solve(n, st):
	ctr = 0
	for s in range(len(st)):
		if s < len(st) - 1:
			if st[s] == st[s + 1]:
				ctr += 1
	return ctr
n = int(input())
st = input()
print(solve(n, st))


userInput = int(input())
imp = input()
count = 0
for i in range(len(imp) - 1):
	if imp[i] == imp[i + 1]:
		count += 1
print(count)


x = int(input())
y = input()
(c, r, g, b) = (0, 0, 0, 0)
for i in range(x):
	if i != x - 1:
		if y[i] == 'R':
			if y[i + 1] == 'R':
				r += 1
			else:
				r = 0
		elif y[i] == 'G':
			if y[i + 1] == 'G':
				g += 1
			else:
				g = 0
		elif y[i] == 'B':
			if y[i + 1] == 'B':
				b += 1
			else:
				b = 0
	if r >= 1 or b >= 1 or g >= 1:
		(r, b, g) = (0, 0, 0)
		c += 1
print(c)


j = 0
n = int(input())
x = input()
for i in range(n - 1):
	if x[i] == x[i + 1]:
		j += 1
print(j)
end = ' '


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)


input()
input_str = input()
current_color = 0
current_neighbour = 1
removed_stones = 0
while current_color < len(input_str) - 1:
	while current_neighbour < len(input_str) and input_str[current_color] == input_str[current_neighbour]:
		current_neighbour += 1
		removed_stones += 1
	current_color = current_neighbour
	current_neighbour += 1
print(removed_stones)


(n, s1, s2, count) = (input(), input(), '1', 0)
for i in s1:
	if i == s2[-1]:
		count += 1
	else:
		s2 = s2 + i
print(count)


a = input('')
b = input('')
current = ''
count = 0
for val in b:
	if val == current:
		count = count + 1
	else:
		current = val
print(count)


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


def calc(n, s):
	stack = []
	r = 0
	for stone in s:
		if not stack:
			stack.append(stone)
		elif stack[0] == stone:
			r += 1
		else:
			stack[0] = stone
	return r
n = int(input())
s = input()
print(calc(n, s))


n = int(input())
s = input()
count = 0
last = ''
for x in range(n):
	if s[x] == last:
		count += 1
	else:
		last = s[x]
print(count)


n = int(input())
s = input()
last = s[0]
count = 0
ans = 0
for i in s[1:]:
	if i == last:
		count += 1
	else:
		ans += count
		count = 0
		last = i
print(ans + count)


x = int(input())
j = input()
temp = 0
ilk = j[0]
for i in j[1:]:
	if i == ilk:
		temp += 1
	ilk = i
print(temp)


import sys
n = int(sys.stdin.readline())
stones = sys.stdin.readline()
cs = 'A'
i = 0
for s in stones:
	if s != cs:
		cs = s
	else:
		i += 1
print(i)


n = int(input())
s = input()
s = [i for i in s]
(count_t, i) = (0, 0)
while i < len(s):
	count = 0
	for j in range(i, len(s)):
		if s[i] == s[j]:
			flag = 0
			count += 1
		else:
			flag = 1
			if count > 1:
				count_t += count - 1
			else:
				count_t += 0
			break
	if flag == 0:
		count_t += count - 1
	i += count
print(count_t)


noOfStones = input()
listOfStones = list(input())
noOfStonesToRemove = 0
if listOfStones.count(listOfStones[0]) == len(listOfStones):
	noOfStonesToRemove = len(listOfStones) - 1
else:
	for i in range(0, len(listOfStones) - 1):
		if listOfStones[i] == listOfStones[i + 1]:
			noOfStonesToRemove += 1
print(noOfStonesToRemove)


num_stones = int(input())
sequence = input()
count = 0
check = sequence[0]
for each in sequence[1:num_stones]:
	if each == check:
		count += 1
	check = each
print(count)


no_stones = int(input())
stones = input()
count = 0
for i in range(len(stones) - 1):
	if stones[i] == stones[i + 1]:
		count += 1
	else:
		pass
print(count)


def main():
	input()
	input_string = input()
	flag = ''
	max_count = 0
	for i in input_string:
		if i == flag:
			max_count += 1
		else:
			flag = i
	print(max_count)
main()


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


number = int(input())
string = input()
(n, result) = ('', 0)
for m in string:
	if m == n:
		result += 1
	n = m
print(result)


n = int(input())
queue = input()
l = len(queue)
lis = list(queue)
count = 0
new_list = [lis[0]]
for i in range(1, n):
	if lis[i] != new_list[-1]:
		new_list.append(lis[i])
	else:
		count += 1
print(count)


n = int(input())
stones = [s for s in input()]
count = 0
actual_stone = stones[0]
for stone in stones[1:]:
	if actual_stone == stone:
		count += 1
	actual_stone = stone
print(count)


def sol(n, s):
	count = 0
	for x in range(1, n):
		if s[x] == s[x - 1]:
			count += 1
	return count
n = int(input())
s = input()
if n > 0 and n <= 50:
	print(sol(n, s))


while True:
	try:
		t = int(input())
		s = input()
		ans = 0
		for i in range(t - 1):
			if s[i] != s[i + 1]:
				ans += 1
		print(t - 1 - ans)
	except:
		break


def testcase(n, k):
	c = 0
	for i in range(n - 1):
		if k[i] == k[i + 1]:
			c += 1
	return c
n = int(input())
k = input()
print(testcase(n, k))


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


N = int(input())
S = input()
Contador = 0
k = 0
while N > 1:
	if S[0 + k] == S[1 + k]:
		Contador = Contador + 1
		N = N - 1
		k = k + 1
	else:
		N = N - 1
		k = k + 1
print(Contador)


input()
(s, x) = (input(''), 0)
for i in range(1, len(s)):
	x += s[i] == s[i - 1]
print(x)


import math

def get_int_vector():
	return [int(x) for x in input().split()]
n = int(input())
seq = input()
result = 0
cnt = 0
for i in range(1, len(seq)):
	if seq[i - 1] == seq[i]:
		cnt += 1
	else:
		result += cnt
		cnt = 0
result += cnt
print(result)


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


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


n = int(input())
s = input()
stack = [s[0]]
count = 0
for i in range(1, n):
	if stack[-1] == s[i]:
		count += 1
	else:
		stack.append(s[i])
print(count)


b = int(input())
a = input()
for i in range(0, b):
	a = a.replace('RR', 'R')
	a = a.replace('BB', 'B')
	a = a.replace('GG', 'G')
c = b - len(a)
print(c)


def moves(input_):
	stones = input_[:]
	stones = list(stones)
	i = 0
	while i + 1 <= len(stones) - 1:
		if len(stones) == 1:
			break
		if stones[i] == stones[i + 1]:
			stones.remove(stones[i])
		else:
			i += 1
	return abs(len(stones) - len(input_))
_ = input()
stones = input()
print(moves(stones))


n = []
while True:
	try:
		line = input()
	except EOFError:
		break
	n.append(line)
k = 0
colors = n[1]
mx = len(colors) - 1
for x in range(0, mx):
	if colors[x] == colors[x + 1]:
		k += 1
print(k)


n = int(input())
s = input()
stack = 1
current = None
stack_list = []
for p in s:
	if current is None:
		current = p
	elif p == current:
		stack += 1
	else:
		stack_list.append(stack)
		stack = 1
		current = p
stack_list.append(stack)
print(n - len(stack_list))


n = int(input().strip())
s = list(input().strip())
removed = 0
lastColor = s[0]
for i in range(1, len(s)):
	if s[i] == lastColor:
		removed += 1
	else:
		lastColor = s[i]
print(removed)


length = int(input())
stones = input()
op = 0
for i in range(len(stones) - 1):
	if stones[i] == stones[i + 1]:
		op += 1
print(op)


m = int(input())
x = input()
res = []
count = 0
for i in range(m - 1):
	if x[i + 1] == x[i]:
		count += 1
	else:
		res.append(count)
		count = 0
res.append(count)
print(sum(res))


n = input()
s = input()
s0 = s
while 'RR' in s:
	s = s.replace('RR', 'R')
while 'BB' in s:
	s = s.replace('BB', 'B')
while 'GG' in s:
	s = s.replace('GG', 'G')
print(len(s0) - len(s))


n = int(input())
s = str(input())
counter = 0
if n >= 1 and n <= 50:
	for i in range(1, n, 1):
		if s[i - 1] == s[i]:
			counter += 1
print(counter)


n = int(input())
s = input()
l = [s[p] for p in range(n)]
R = 0
G = 0
B = 0
t = []
for i in range(0, n):
	if s[i] == 'R':
		t += [G, B]
		B = 0
		G = 0
		R += 1
	if s[i] == 'G':
		t += [R, B]
		B = 0
		R = 0
		G += 1
	if s[i] == 'B':
		t += [R, G]
		G = 0
		R = 0
		B += 1
t += [G, B, R]
Y = [t[z] for z in range(len(t)) if t[z] > 1]
print(sum(Y) - len(Y))


import sys
import os.path
if os.path.exists('in.txt'):
	sys.stdin = open('in.txt', 'r')
	sys.stdout = open('out.txt', 'w')
n = int(input())
ans = 0
s = input()
for i in range(n - 1):
	if s[i] == s[i + 1]:
		ans += 1
print(ans)


n = int(input().strip())
stones = list(input().strip())
count = 0
for i in range(1, len(stones)):
	if stones[i] == stones[i - 1]:
		count += 1
print(count)


def stones_on_the_table():
	n_stones = int(input())
	n_stones_origin = n_stones
	stones = str(input())
	i = 0
	while i < n_stones - 1:
		if stones[i] == stones[i + 1]:
			n_stones -= 1
			stones = stones[:i + 1] + stones[i + 2:]
		else:
			i += 1
	print(n_stones_origin - n_stones)
stones_on_the_table()


ln = int(input())
rks = input()
rm = 0
for i in range(1, len(rks)):
	if rks[i] == rks[i - 1]:
		rm += 1
print(rm)


n = int(input())
str_0 = input()
list_0 = list(str_0)
x = 0
for i in range(n - 1):
	if list_0[i] == list_0[i + 1]:
		x = x + 1
print(x)


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


k = int(input())
stones = list(str(input()))
j = 0
dealed = []
for i in range(k - 1):
	p = i + 1
	if stones[i] == stones[p]:
		j += 1
print(j)


num = int(input())
stones = input()
result = 0
current = ''
for c in stones:
	if c == current:
		result += 1
	current = c
print(result)


n = int(input())
a = list(input().split())
b = list(a[0])
sum = 0
for i in range(n - 1):
	if b[i] == b[i + 1]:
		sum = sum + 1
	else:
		sum = sum
print('%d' % sum)


n = int(input())
colstr = input()
recnt = 0
col0 = ''
for ix in range(0, n):
	col1 = colstr[ix]
	if col1 == col0:
		recnt += 1
	col0 = col1
print(recnt)


stones = int(input())
n = input()
moves = 0
previousColor = None
for i in n:
	if previousColor == i:
		moves += 1
	else:
		previousColor = i
print(moves)


n = int(input())
masukan = [item for item in input()]
res = []
for i in range(n - 1):
	if masukan[i] == masukan[i + 1]:
		res.append(1)
print(sum(res))


a = int(input())
b = str(input())
count = 0
for x in range(a):
	if b[x] == b[x - 1] and (not x == 0):
		count += 1
print(count)


n = int(input())
s = input()
l = []
for i in s:
	l.append(ord(i))
c = 0
for i in range(n - 1):
	diff = l[i] - l[i + 1]
	if diff == 0:
		c += 1
print(c)


n = int(input())
s = list(input())
j = 0
for i in range(len(s) - 1):
	if s[i] == s[i + 1]:
		j = j + 1
	else:
		pass
print(j)


def main():
	_ = input()
	stones = input()
	if len(stones) == 1:
		print(0)
		return
	compare_to = stones[0]
	i = 1
	moves = 0
	while i < len(stones):
		if compare_to == stones[i]:
			moves += 1
		else:
			compare_to = stones[i]
		i += 1
	print(moves)
main()


import sys
from collections import Counter
from itertools import *
n = int(input())
s = [i for i in input()]
i = n - 1
cur_count = 0
while i > 0:
	if s[i] != s[i - 1]:
		i = i - 1
	else:
		cur_count = cur_count + 1
		i = i - 1
print(cur_count)


nInputs = eval(input())
inputs = input()
current = inputs[0]
count = 0
for i in range(1, len(inputs)):
	latter = current
	current = inputs[i]
	if current == latter:
		count += 1
print(count)


n = int(input())
a = input()
p = a[0]
d = -1
for i in a:
	if i == p:
		d = d + 1
	p = i
print(d)


input()
s = list(input())
r = 0
b = s[0]
for i in range(1, len(s)):
	if s[i] == b:
		r += 1
	else:
		b = s[i]
print(r)


n = input()
inn = input()
prev = ''
counter = 0
for c in inn:
	if c == prev:
		counter += 1
	prev = c
print(counter)


n = int(input())
a = input()
o = 0
c = list(a)
v = 0
for i in c:
	if v == 0:
		pass
	elif i == c[v - 1]:
		o += 1
	v += 1
print(o)


import re
n = int(input())
s = input()
t = s
for i in 'RGB':
	t = re.sub(i + '+', i, t)
print(len(s) - len(t))


from sys import stdout
amount = input()
stones = list(input())
prev = ''
out = 0
for i in range(0, len(stones)):
	cur = stones[i]
	if cur == prev:
		out += 1
	prev = cur
stdout.write(str(out))


from collections import Counter
import math
import sys
from bisect import bisect, bisect_left, bisect_right

def input():
	return sys.stdin.readline().strip()

def INT():
	return int(input())

def MAP():
	return map(int, input().split())

def LIST(N=None):
	return list(MAP()) if N is None else [INT() for i in range(N)]

def mod():
	return 10 ** 9 + 7
n = INT()
s = input()
i = 0
ans = 0
while i < len(s) - 1:
	if s[i] == s[i + 1]:
		ans += 1
	i += 1
print(ans)


def solve(s):
	ns = 0
	last = ''
	for c in s:
		if last == c:
			ns += 1
		else:
			last = c
	return ns
n = int(input())
s = input()
print(solve(s))


n = int(input())
str1 = input()
count = 0
list1 = []
for i in range(len(str1)):
	list1.append(str1[i])
for i in range(len(str1) - 1):
	if list1[i] == list1[i + 1]:
		count += 1
print(count)


num = int(input())
prev_colour = ''
min_change = 0
colours = str(input())
for i in range(num):
	if colours[i] == prev_colour:
		min_change += 1
	prev_colour = colours[i]
print(min_change)


def dcp(s):
	ans = []
	c = 1
	for i in range(1, len(s)):
		if s[i - 1] == s[i]:
			c += 1
		else:
			ans.append(c)
			c = 1
	if c != 1:
		ans.append(c)
	return ans
n = int(input())
a = input()
print(sum(list(map(lambda x: x - 1, dcp(a)))))


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


nmbr = int(input())
stones = input()
ans = 0
i = 1
while i < nmbr:
	if stones[i] == stones[i - 1]:
		ans += 1
	i += 1
print(ans)


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


l = int(input())
s = input()
ans = 0
while s:
	a = len(s)
	s = s.lstrip(s[0])
	ans += a - len(s) - 1
print(ans)


num = int(input())
row = input()
aaa = row[0]
ans = 0
dijige = 0
for i in row[1:]:
	if i == aaa:
		ans += 1
	dijige += 1
	aaa = row[dijige]
print(ans)


def mod():
	n = int(input())
	x = input()
	c = 0
	for i in range(len(x)):
		if i != n - 1:
			if x[i] == x[i + 1]:
				c += 1
		else:
			print(c)
mod()


n = int(input())
s = input()
arr = []
c = 0
for i in s:
	arr.append(i)
i = 0
j = 1
if len(arr) == 1:
	print('0')
else:
	while i < n and j < n:
		if arr[i] == arr[j]:
			c += 1
			arr[j] = 'A'
			j += 1
		else:
			i = j
			j += 1
	print(c)


import itertools
print(int(input()) - len(list(itertools.groupby(input()))))


n = int(input())
stones = input().upper()
duplicate = 1
i = 0
while True:
	if i + 1 > n - 1:
		break
	while stones[i] == stones[i + 1]:
		duplicate += 1
		i += 1
		if i + 1 > n - 1:
			break
	i += 1
print(duplicate - 1)


(number_of_stones, stones) = (int(input()), input())
previous_stone = stones[0]
count_of_swaps = 0
for stone in stones[1:]:
	if stone == previous_stone:
		count_of_swaps += 1
	else:
		previous_stone = stone
print(count_of_swaps)


n = int(input())
col = input()
curr = col[0]
count = 0
for i in col[1:]:
	if i == curr:
		count += 1
	else:
		curr = i
print(count)


a = int(input())
s = input()
(r, g, b) = (0, 0, 0)
for i in range(len(s) - 1):
	if s[i] == s[i + 1]:
		if s[i] == 'R':
			r += 1
		elif s[i] == 'G':
			g += 1
		else:
			b += 1
print(r + g + b)


n = int(input())
stone = input()

def isSame(stones):
	flag = False
	length = len(stones)
	for i in range(length):
		if i != length - 1 and stones[i] == stones[i + 1]:
			flag = True
			break
	if flag == True:
		return i + 1
	else:
		return -1
result = stone
count = 0
while isSame(result) != -1:
	i = isSame(result)
	newString = result[0:i] + result[i + 1:]
	result = newString
	count += 1
print(count)


numstones = int(input())
stones = input()
stoneslist = []
for i in stones:
	stoneslist.append(i)
numremove = 0
for i in range(numstones - 1):
	if stoneslist[i] == stoneslist[i + 1]:
		numremove += 1
print(numremove)


n = int(input())
text = input()
counter = 0
if len(text) < 1:
	print('0')
else:
	iterator = iter(text)
	try:
		previous = next(iterator)
		for i in range(1, len(text)):
			current = next(iterator)
			if current == previous:
				counter += 1
			else:
				previous = current
	except StopIteration:
		pass
print(counter)


num = int(input())
string = input()
if num > len(string):
	print(0)
else:
	count = 0
	tmp_count = 0
	is_first = True
	for i in range(num):
		if is_first:
			is_first = False
			tmp_count = 1
		elif string[i - 1] == string[i]:
			tmp_count += 1
		elif tmp_count > 1:
			count += tmp_count - 1
			tmp_count = 1
	if tmp_count > 1:
		count += tmp_count - 1
	print(count)


def kek(x):
	for i in range(1, len(x)):
		if x[i] == x[i - 1]:
			return kek(x[:i] + x[i + 1:])
	return x
input()
heh = input()
print(len(heh) - len(kek(heh)))


num = int(input())
stones = list(input())
l = []
first = stones[0]
n = 0
for i in range(1, len(stones)):
	if first == stones[i]:
		l.append(stones[i])
	else:
		first = stones[i]
print(len(l))


input()
s = input()
total = 0
x = -1
for i in s[1:]:
	x += 1
	if i == s[x]:
		total += 1
print(total)


n = int(input())
s = input()
q = len(s)
m = 0
for i in range(2, q + 1):
	if ord(s[i - 2]) == ord(s[i - 1]):
		m = m + 1
	else:
		pass
print(m)


n = input()
c = input()
n = 'a'
x = 0
for i in c:
	if i == n:
		x += 1
	else:
		n = i
print(x)


n = int(input())
b = input()
a = []
flag = 0
for i in range(len(b)):
	a.append(b[i])
i = 0
while i <= n - 2:
	if a[i] == a[i + 1]:
		flag += 1
	else:
		i += 1
		continue
	i += 1
print(flag)


n = int(input())
a = [elem for elem in input()]
i = 0
k = 0
while i < len(a) - 1:
	if a[i] == a[i + 1]:
		a.pop(i + 1)
		k += 1
	else:
		i += 1
print(k)


n = int(input())
st = input()
curr = st[0]
pick = 0
for i in range(1, len(st)):
	if curr == st[i]:
		pick += 1
	curr = st[i]
print(pick)


k = int(input())
s = input()
i = 0
cnt = 0
while i < len(s) - 1:
	if s[i] == s[i + 1]:
		cnt += 1
		s = s[:i] + s[i + 1:]
	else:
		i += 1
print(cnt)


n = int(input())
stone = input()
i = 1
count = 0
ch = stone[0]
while i != n:
	if ch == stone[i]:
		count = count + 1
		ch = stone[i]
	else:
		ch = stone[i]
	i = i + 1
print(count)


n = int(input())
s = input()
q = [0, 0, 0]
c = 0
for i in s:
	if i == 'R':
		if q[0]:
			c += 1
		q[0] = 1
		q[1] = 0
		q[2] = 0
	if i == 'G':
		if q[1]:
			c += 1
		q[0] = 0
		q[1] = 1
		q[2] = 0
	if i == 'B':
		if q[2]:
			c += 1
		q[0] = 0
		q[1] = 0
		q[2] = 1
print(c)


n = int(input())
s = input()
k = 0
i = 0
if n == 1:
	print(0)
else:
	while True:
		if s[i] == s[i + 1]:
			k += 1
		i += 1
		if i == n - 1:
			break
	print(k)


input()
x = input()
x = x.lower()
a = x[0]
b = 0
for i in range(1, len(x)):
	if x[i] == a:
		b += 1
	else:
		a = x[i]
print(b)


n = int(input())
li = input()
su = 0
for i in range(n):
	if i == 0:
		g = li[i]
		continue
	if g == li[i]:
		su += 1
	g = li[i]
print(su)


l = int(input())
t = input()
t1 = t.upper()
c = 0
for i in range(0, l - 1):
	if t1[i] == t1[i + 1]:
		c += 1
	else:
		continue
print(c)


a = int(input())
l = []
l = list(input())
sum1 = 0
sum2 = 0
sum3 = 0
sum4 = 0
summ = 0
n = 0
while n < a - 1:
	num1 = l[n]
	num2 = l[n + 1]
	if num1 == num2:
		summ += 1
	n += 1
print(summ)


m = int(input())
stones = input()
ans = 0
for i in range(m - 1):
	if stones[i] == stones[i + 1]:
		ans = ans + 1
print(ans)


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


junk = input()
colors = input()
colors_out = []
previous = ''
remove_count = 0
for color in colors:
	if color == previous:
		remove_count += 1
		continue
	previous = color
	colors_out.append(color)
print(remove_count)


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


no = int(input())
values = list(map(str, input()))
count = 0
for i in range(1, len(values)):
	if values[i] == values[i - 1]:
		count += 1
print(count)


stones = input()
setup = input()
stones = int(stones)
data = list(setup)
x = 0
point = 0
removed = 0
while x < stones - 1:
	if data[point] == data[point + 1]:
		data.remove(data[point + 1])
		removed += 1
	else:
		point += 1
	x += 1
print(removed)


no = input()
count = 0
Color_sceme = str(input())
length = len(Color_sceme)
for each in range(0, length - 1):
	if Color_sceme[each] == Color_sceme[each + 1]:
		count += 1
	else:
		count += 0
print(count)


i = input()
l = [char for char in input()]
prev = l[0]
count = -1
for i in range(int(i)):
	if l[i] == prev:
		count += 1
	else:
		prev = l[i]
print(count)


a = int(input())
b = []
b = list(input())
c = 0
j = 0
while c < len(b) - 1:
	if b[c] == b[c + 1]:
		j = j + 1
	c = c + 1
print(j)


n = input()
colors = input()
counter = 0
while True:
	for i in range(1, int(n)):
		if colors[i] == colors[i - 1]:
			counter += 1
			colors.replace(colors[i - 1], '')
	break
print(counter)


input()
n = input()
a = len(n)
for q in range(len(n) // 2 + 1):
	n = n.replace('RR', 'R')
	n = n.replace('GG', 'G')
	n = n.replace('BB', 'B')
print(a - len(n))


n = int(input())
chars = input()
base = chars[0]
overall = 0
for i in range(1, len(chars)):
	currentElement = chars[i]
	if base == currentElement:
		overall += 1
	base = currentElement
print(overall)


num = int(input())
row = input()
li = list(row)
while 'RR' in row:
	row = row.replace('RR', 'R')
while 'GG' in row:
	row = row.replace('GG', 'G')
while 'BB' in row:
	row = row.replace('BB', 'B')
print(num - len(row))


n = int(input())
string = input()
answer = 0
for i in range(n):
	if string[i:i + 1] == string[i + 1:i + 2]:
		answer += 1
print(answer)


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


def removals(stones):
	to_remove = 0
	current = 0
	for i in range(len(stones) - 1):
		if stones[current] == stones[i + 1]:
			to_remove += 1
		else:
			current = i + 1
	return to_remove
n = int(input())
print(removals(list(input())))


k = 0

def pr(y, x):
	global k
	for i in range(1, y):
		if x[i - 1] == x[i]:
			x.pop(i)
			k += 1
			pr(y - 1, x)
			break
(pr(int(input()), list(input())), print(k))


def main():
	stone_count = input()
	stones = input()
	count = 0
	i = 0
	while i + 1 < int(stone_count):
		stone_prev = stones[i]
		stone_current = stones[i + 1]
		if stone_current == stone_prev:
			count += 1
		i += 1
	print(count)
main()


num = int(input())
string = input()
counter = 0
for i in range(num):
	try:
		if string[i] == string[i + 1]:
			counter += 1
	except IndexError:
		pass
print(counter)


tl = int(input())
a = list(input())
l = len(a)
i = 0
while i < l and len(a) > 1:
	if i == 0 and a[i] == a[i + 1]:
		a.pop(i)
		l -= 1
	elif i == len(a) - 1 and a[i] == a[i - 1]:
		a.pop(i)
		l -= 1
	elif i != 0 and a[i] == a[i - 1] or (i != len(a) - 1 and a[i] == a[i + 1]):
		a.pop(i)
		l -= 1
	else:
		i += 1
print(tl - len(a))


from itertools import groupby
from operator import itemgetter
n = int(input())
stones = input()
stones_removed = list(map(itemgetter(0), groupby(stones)))
print(len(stones) - len(stones_removed))


n = int(input(''))
L = input('')
cont = 0
k = 0
T = ''
while k < n - 1:
	if L[k] == L[k + 1]:
		T += L[k]
	k += 1
print(len(T))


input()
arr = input().rstrip()
counter = 0
for i in range(1, len(arr)):
	if arr[i] == arr[i - 1]:
		counter += 1
print(counter)


n = int(input())
string = input()
previous_char = string[0]
output = 0
index = 1
while index < len(string):
	next_char = string[index]
	if previous_char == next_char:
		output += 1
	else:
		previous_char = string[index]
	index += 1
print(output)


total_stones = int(input())
stones = list(input())
stone_count = 0
for i in range(total_stones):
	if i - 1 > -1 and stones[i - 1] == stones[i]:
		stone_count += 1
print(stone_count)


n = int(input())
str = input()
l = list(str)
lis = [n]
lis[0] = l[0]
for i in range(1, len(l)):
	if l[i] == l[i - 1]:
		continue
	lis.append(l[i])
print(len(l) - len(lis))


n = int(input())
w = list(input())
s = []
if n > 1:
	for i in range(n - 1):
		if w[i] == w[i + 1]:
			s.append(w[i])
	print(len(s))
else:
	print(0)


n = int(input())
stones = list(str(input()))
count = 0
i = 1
while i <= n - 1:
	if stones[i - 1] == stones[i]:
		stones.pop(i)
		n -= 1
		count += 1
	else:
		i += 1
print(count)


from sys import stdin
n = int(stdin.readline().strip())
s = stdin.readline().strip()
str_arr = list(s)
num_deletes = 0
i = n - 1
while i >= 1:
	if str_arr[i] == str_arr[i - 1]:
		del str_arr[i]
		num_deletes += 1
	i -= 1
print(num_deletes)


def getAns(size, word):
	count = 0
	i = 1
	while i < size:
		while i < size and word[i] == word[i - 1]:
			i += 1
			count += 1
		i += 1
	return count
size = int(input())
word = input()
print(getAns(size, word))


n = int(input())
s = str(input())
r = int(0)
for x in range(n):
	if x + 2 <= n - 1:
		if s[x] == s[x + 1] and s[x] == s[x + 2]:
			r = r + 1
		elif s[x] == s[x + 1]:
			r = r + 1
	elif x + 1 <= n - 1:
		if s[x] == s[x + 1]:
			r = r + 1
print(r)


import re

def cn(s):
	v = re.findall('(r{2,}|g{2,}|b{2,})', s, re.I)
	return sum([len(x) for x in v]) - len(v)
input()
print(cn(input()))


n = input()
colors = input()
counter = 0
i = 0
while i < len(colors) - 1:
	if colors[i] == colors[i + 1]:
		colors = colors[1:]
		counter += 1
	else:
		i += 1
print(counter)


n = int(input())
word = input()
x = 0
i = 0
while i <= len(word) - 2:
	if word[i] == word[i + 1]:
		x = x + 1
		word = word[:i + 1] + word[i + 2:]
	else:
		i = i + 1
print(str(x))


n = int(input())
s = input()
lastcolor = 0
ans = 0
for x in s:
	if x == lastcolor:
		ans += 1
	lastcolor = x
print(ans)


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


def StonesOnTable():
	n = int(input())
	stones = input().strip()
	rep = 0
	for i in range(n - 1):
		if stones[i] == stones[i + 1]:
			rep += 1
	return rep
a = StonesOnTable()
print(a)


import sys
input = sys.stdin.readline

def inp():
	return int(input())

def insr():
	s = input()
	return list(s[:len(s) - 1])

def solve(n, s):
	(i, j, count) = (0, 1, 0)
	while i < n and j < n:
		if s[i] == s[j]:
			count += 1
		i += 1
		j += 1
	return count
n = inp()
s = insr()
res = solve(n, s)
print(res)


n = int(input())
colorsList = list(input())
first = 0
second = 1
counter = 0
while second < len(colorsList) and len(colorsList) > 0:
	if colorsList[first] == colorsList[second]:
		colorsList.remove(colorsList[first])
		counter += 1
	try:
		if colorsList[first] != colorsList[second]:
			first += 1
			second += 1
	except:
		break
print(counter)


a = int(input())
b = input()
M = 1
for i in range(a - 1):
	if b[i] != b[i + 1]:
		M = M + 1
print(a - M)


a = int(input())
t = 0
s = input()
p = 0
for j in range(a - 1):
	if s[j] == s[j + 1]:
		p += 1
	else:
		t += p
		p = 0
t += p
print(t)


n = int(input())
row = input().upper()
i = 0
a = 0
while i < len(row) - 1:
	if row[i] == row[i + 1]:
		a += 1
	i += 1
print(a)


n = input()
n = int(n)
s = input()
i = 0
m = len(s)
while i < m - 1:
	if s[i] == s[i + 1]:
		x = s[:i]
		y = s[i + 1:]
		s = x + y
		m = len(s)
	else:
		i = i + 1
m = len(s)
diff = n - m
print(diff)


no_of_stones = int(input())
stones = input()
no_of_moves = 0
for index in range(no_of_stones - 1):
	if stones[index] == stones[index + 1]:
		no_of_moves += 1
print(no_of_moves)


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


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


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


length = int(input())
stones = input()
prev = stones[0]
switchout = 0
for index in range(1, length):
	next_stone = stones[index]
	if next_stone == prev:
		switchout += 1
	prev = next_stone
print(switchout)


q = int(input())
a = input()
b = list(a)
n0 = b.count('R')
m0 = b.count('G')
p0 = b.count('B')
t = 0
while 'RR' in a:
	a = a.replace('RR', 'R')
b1 = list(a)
n1 = b1.count('R')
while 'GG' in a:
	a = a.replace('GG', 'G')
b2 = list(a)
m1 = b2.count('G')
while 'BB' in a:
	a = a.replace('BB', 'B')
b3 = list(a)
p1 = b3.count('B')
t = n0 + m0 + p0 - n1 - m1 - p1
print(t)


input()
balls = input()
temp = 'w'
count = 0
for c in balls:
	if temp == c:
		count += 1
	else:
		temp = c
print(count)


l = input()
a = input()
x = 0
for i in range(len(a)):
	for j in range(len(a)):
		if j == len(a) - 1:
			break
		if a[j] == a[j + 1]:
			if j == 0:
				a = a[1:]
			else:
				a = a[:j] + a[j + 1:]
			x += 1
			break
print(x)


b = int(input())
a = input()
ans = 0
for m in range(1, b):
	if a[m] == a[m - 1]:
		ans += 1
print(ans)


n = int(input())
s = input()
last = '0'
amount = 0
for i in s:
	if last == i:
		amount += 1
	last = i
print(amount)


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


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


n = int(input())
A = input()
B = []
count = 0
sum = 0
for i in A:
	B.append(i)
for j in range(0, len(B) - 1):
	if B[j] == B[j + 1]:
		sum = sum + 1
print(sum)


n = int(input())
a = input()
c = 0
i = 0
while i + 1 < n:
	if a[i] == a[i + 1]:
		c += 1
	i += 1
print(c)


m = int(input())
s = input()
count = 0
a = s[0]
for i in range(1, m):
	if s[i] == a:
		count += 1
	else:
		a = s[i]
print(count)


n = int(input()) - 1
b = input()
count = 0
x = 0
y = 1
for colour in b:
	if n > 0:
		if b[x] == b[y]:
			count += 1
		x += 1
		y += 1
	n -= 1
print(count)


n = input()
n = int(n)
a = []
a = input().split()
r = 0
for j in range(len(a[0]) - 1):
	if a[0][j] == 'G' and a[0][j + 1] == 'G':
		r += 1
	if a[0][j] == 'B' and a[0][j + 1] == 'B':
		r += 1
	if a[0][j] == 'R' and a[0][j + 1] == 'R':
		r += 1
print(r)


n = int(input())
s = input()
l = len(s)

def fn(s):
	if 'RR' in s:
		s = s.replace('RR', 'R')
	elif 'BB' in s:
		s = s.replace('BB', 'B')
	elif 'GG' in s:
		s = s.replace('GG', 'G')
	if 'RR' in s or 'BB' in s or 'GG' in s:
		return fn(s)
	else:
		return l - len(s)
print(fn(s))


def main():
	num = input()
	stones = input()
	i = 0
	output = 0
	while i < len(stones) - 1:
		similar = 1
		while i < len(stones) - 1 and stones[i] == stones[i + 1]:
			similar += 1
			i += 1
		output += similar - 1
		i += 1
	print(output)
main()


n = int(input())
stones = input()
previous_stone = ''
remove_count = 0
for stone in stones:
	if previous_stone == '':
		pass
	elif stone == previous_stone:
		remove_count += 1
	previous_stone = stone
print(remove_count)


import sys
import os

def int_array():
	return list(map(int, input().strip().split()))

def str_array():
	return input().strip().split()

def gcd(a, b):
	if b == 0:
		return a
	return gcd(b, a % b)

def take_input():
	if os.environ.get('check'):
		sys.stdin = open('input.txt', 'r')
		sys.stdout = open('output.txt', 'w')
take_input()
n = int(input())
count = 0
s = list(input())
for i in range(n - 1):
	if s[i] == 'R' and s[i + 1] == 'R':
		count += 1
	elif s[i] == 'B' and s[i + 1] == 'B':
		count += 1
	elif s[i] == 'G' and s[i + 1] == 'G':
		count += 1
print(count)


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


n = int(input())
word = input()
m = 0
if n == 1:
	print(0)
else:
	for i in range(n):
		if i == n:
			m = m
		elif i == n - 1:
			m = m
		elif word[i] == word[i + 1]:
			m = m + 1
	print(m)


class solution:

	def __init__(self):
		self.list1 = []
		self.count = 0

	def str_input(self):
		str2 = input()
		str1 = input()
		temp = list(str1)
		self.list1 = temp
		del temp

	def sort_stone(self):
		for i in range(len(self.list1)):
			try:
				assert i < len(self.list1) - 1
				if self.list1[i] == self.list1[i + 1]:
					self.count += 1
				i += 1
			except:
				break

	def str_output(self):
		print(self.count)

	def execute(self):
		self.str_input()
		self.sort_stone()
		self.str_output()

def main():
	s1 = solution()
	s1.execute()
main()


input()
s = input()
r = 0
for x in range(len(s) - 1):
	r += 1 if s[x] == s[x + 1] else 0
print(r)


n = input()
astr = input()
rmv = 0
flag = 0
for i in range(len(astr)):
	try:
		if astr[i] == astr[i + 1]:
			flag = flag + 1
	except:
		continue
if flag == len(astr) - 1:
	print(flag)
else:
	for i in range(len(astr)):
		try:
			if astr[i] == astr[i + 1]:
				rmv = rmv + 1
		except:
			break
	print(rmv)


def solve(stones, c):
	for i in range(len(stones) - 1):
		if stones[i] == stones[i + 1]:
			stones.pop(i)
			return solve(stones, c + 1)
	return c
n = int(input())
stones = list(input())
c = 0
print(solve(stones, c))


def check_neighbor(string):
	for i in range(len(string) - 1):
		if string[i] == string[i + 1]:
			return True
	return False

def remove_neighbor(string):
	for i in range(len(string) - 1):
		if string[i] == string[i + 1]:
			return string[:i] + string[i + 1:]
num = input()
stones = input()
times = 0
while True:
	if check_neighbor(stones):
		stones = remove_neighbor(stones)
		times = times + 1
		continue
	else:
		print(times)
		break


stn_no = input()
stn_no = int(stn_no)
stones = input()
stone_list = list(stones)
removed = 0
for i in range(1, stn_no):
	if stone_list[i] == stone_list[i - 1]:
		removed = removed + 1
print(removed)


l = int(input(''))
n = 0
s = input('')
while sum([i in s for i in ['RR', 'GG', 'BB']]):
	n += s.count('RR') + s.count('GG') + s.count('BB')
	s = s.replace('RR', 'R').replace('GG', 'G').replace('BB', 'B')
print(l - len(s))


a = int(input())
b = input()
z = 0
for x in range(a - 1):
	if b[x] == b[x + 1]:
		z = z + 1
print(z)


n = int(input())
s = input()
q = 1
x = 0
while True:
	if q >= n:
		print(x)
		break
	if s[q - 1] == s[q]:
		q = q + 1
		x = x + 1
	else:
		q = q + 1


num_rocks = int(input())
rocks = input()
a = 1
remove = 0
while a < num_rocks:
	if rocks[a] == rocks[a - 1]:
		remove += 1
	a += 1
print(remove)


numberOfStones = input('')
stonesRefined = list(input(''))
neededStones = 0
for stone in range(int(numberOfStones)):
	if stone > 0:
		if stonesRefined[stone - 1] == stonesRefined[stone]:
			neededStones = neededStones + 1
print(neededStones)


x = input()
q = input()
a = list(q)
a = [ch for ch in q]
k = 0
for j in range(len(a) - 1):
	for i in range(len(a) - 1):
		if a[i] == a[i + 1]:
			a.pop(i + 1)
			k += 1
			break
print(k)


n = input()
li = []
for j in input():
	li.append(j)
var = li[0]
res = -1
for i in li:
	if i == var:
		res += 1
	else:
		var = i
print(res)


x = y = 0
input()
for m in input():
	x += y == m
	y = m
print(x)


n = int(input())
s = input()
r = s.find('RR')
g = s.find('GG')
b = s.find('BB')
c = 0
while r != -1:
	r = s.find('RR')
	s = s[:r] + s[r + 1:]
	r = s.find('RR')
	c = c + 1
while g != -1:
	g = s.find('GG')
	s = s[:g] + s[g + 1:]
	g = s.find('GG')
	c = c + 1
while b != -1:
	b = s.find('BB')
	s = s[:b] + s[b + 1:]
	b = s.find('BB')
	c = c + 1
print(c)


n = int(input())
s = input()
if len(s) - 1 == 0:
	print(0)
else:
	cont = 0
	i = 0
	while i < len(s) - 1:
		if s[i] == s[i + 1]:
			cont += 1
			i += 1
		else:
			i += 1
		if i == len(s) - 1:
			break
	print(cont)


input()
s = input()
l = s[0]
ct = -1
for c in s:
	if c == l:
		ct += 1
	l = c
print(ct)


n = int(input())
s = input()
counter = 0
for j in range(1, len(s)):
	if s[j] == s[j - 1]:
		counter += 1
	else:
		counter += 0
print(counter)


n = int(input())
c = input()
ct = 0
for (p, n) in zip(c[1:], c):
	if p == n:
		ct += 1
print(ct)


n = int(input())
a = input()
counter = 0
for i in range(n - 1):
	if a[i] != a[i + 1]:
		pass
	else:
		counter += 1
print(counter)


n = int(input())
c = input()
l = list()
count = 0
r = 0
l.append(c[0])
for i in range(1, n):
	if c[i] == l[r]:
		count = count + 1
	else:
		r = r + 1
		l.append(c[i])
print(count)


a = int(input())
b = input()
c = 0
d = 0
while c < a - 1:
	if b[c] == b[c + 1]:
		d += 1
	c += 1
print(d)


n = int(input())
s = list(input())
s = list(filter(lambda x: x != '', s))
c = 0
p = s[0]
i = 1
while i < n:
	if p == s[i]:
		c += 1
		i += 1
		continue
	else:
		p = s[i]
		i += 1
print(c)


__author__ = 'widoc'
n = int(input())
stones = input()
i = 0
rem = 0
while i < n - 1:
	if stones[i] == stones[i + 1]:
		rem += 1
	i += 1
print(rem)


n = int(input())
symbols = str(input())
leng = len(symbols)
for i in range(n):
	symbols = symbols.replace('RR', 'R')
	symbols = symbols.replace('GG', 'G')
	symbols = symbols.replace('BB', 'B')
print(leng - len(symbols))


a = int(input())
b = input()
c = []
q = 0
for i in range(len(b)):
	c.append(b[i])
i = 0
while i != len(c):
	while i + 1 != len(c) and c[i] == c[i + 1]:
		del c[i + 1]
		q += 1
	i += 1
print(q)


i = int(input())
ch = list(input())
leng = len(ch)
cal = 0
count = 0
for cal in range(leng):
	if cal == leng - 1:
		break
	elif ch[cal] == ch[cal + 1]:
		count += 1
print(count)


n = int(input())
l = input()
c = 0
nn = 0
for s in l:
	if nn < n - 1:
		if s is l[nn + 1]:
			c += 1
		nn += 1
print(c)


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


import os
n = int(input())
stones = input().rstrip()
l = 1
pick = '' + stones[0]
for i in range(1, len(stones)):
	if stones[i] != pick[-1]:
		l += 1
		pick += stones[i]
print(len(stones) - l)


n = int(input())
word_string = input()
count = 0
while True:
	if 'RR' in word_string:
		ind_start = word_string.index('RR')
		for i in range(len(word_string)):
			if ind_start + i + 1 < len(word_string) and word_string[ind_start + i + 1] == 'R':
				ind_end = ind_start + i + 2
				count += 1
			else:
				break
		word_string = word_string.replace(word_string[ind_start:ind_end], 'R', 1)
	elif 'GG' in word_string:
		ind_start = word_string.index('GG')
		for i in range(len(word_string)):
			if ind_start + i + 1 < len(word_string) and word_string[ind_start + i + 1] == 'G':
				ind_end = ind_start + i + 2
				count += 1
			else:
				break
		word_string = word_string.replace(word_string[ind_start:ind_end], 'G', 1)
	elif 'BB' in word_string:
		ind_start = word_string.index('BB')
		for i in range(len(word_string)):
			if ind_start + i + 1 < len(word_string) and word_string[ind_start + i + 1] == 'B':
				ind_end = ind_start + i + 2
				count += 1
			else:
				break
		word_string = word_string.replace(word_string[ind_start:ind_end], 'B', 1)
	else:
		break
print(count)


from sys import stdin
input = stdin.readline
a = int(input())
string = input()
count = 0
for i in range(a - 1):
	if string[i] == string[i + 1]:
		count += 1
print(count)


stones = int(input())
if 1 <= stones <= 50:
	color = list(input())
	count = 0
	for i in range(len(color) - 1):
		if color[i] == color[i + 1]:
			count += 1
	print(count)


def main():
	_ = input()
	stones = input()
	tally = 0
	prev_stone = None
	for stone in stones:
		if stone == prev_stone:
			tally += 1
		prev_stone = stone
	print(tally)
main()


n = input()
colors_arr = str(input())
result = 0
last_dead_el_index = 0
y = 0
for x in range(1, len(colors_arr)):
	if colors_arr[y] == colors_arr[x]:
		result = result + 1
		last_dead_el_index = x
	elif last_dead_el_index >= y:
		y = last_dead_el_index + 1
	else:
		y = y + 1
print(result)


n = int(input())
s = list(map(str, input()))
ans = 0
if len(set(s)) == n:
	print(0)
else:
	for i in range(len(s)):
		if i != n - 1:
			if s[i] == s[i + 1]:
				ans += 1
			else:
				continue
		else:
			break
	print(ans)


n = int(input())
s = list(input())
count = 0
for i in range(0, n):
	for j in range(i + 1, n):
		if s[i] == s[j]:
			count += 1
			break
		else:
			break
print(count)


n = int(input())
lines = [w for w in input()]
lines1 = []
for i in range(1, n):
	if lines[i - 1] == lines[i]:
		lines1.append(lines[i - 1])
print(len(lines1))


n = int(input())
stones = list(input())
i = 1
while i in range(len(stones)):
	if stones[i] == stones[i - 1]:
		stones.pop(i)
	else:
		i = i + 1
print(n - len(stones))


n = int(input())
arr = list(input())
prev = 'X'
ctr = 0
for ch in arr:
	if ch == prev:
		ctr += 1
	prev = ch
print(str(ctr))


n = int(input())
s = input()
score = 0
i = 0
while i < n - 1:
	j = 1
	while i + j < n and s[i] == s[i + j]:
		score += 1
		j += 1
	i += j
print(score)


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


t = int(input())
a = input()
m = list(a)
k = 0
for i in range(0, len(m) - 1):
	if m[i] == m[i + 1]:
		k = k + 1
print(k)


b = int(input(''))
a = input('')
x = []
p = 0
q = 0
for i in range(len(a)):
	x.append(a[p])
	p = p + 1
for j in range(len(a) - 1):
	if a[q] == a[q + 1]:
		x.remove(a[q])
	q = q + 1
d = len(a) - len(x)
print(d)


t = int(input())
listans = [j for j in input()]
counter = 0
for i in range(len(listans) - 1):
	if listans[i] == listans[i + 1]:
		counter += 1
print(counter)


i = int(input())
j = input()
k = j.count('RB')
l = j.count('RG')
m = j.count('BR')
a = j.count('BG')
b = j.count('GB')
c = j.count('GR')
n = k + l + m + a + b + c + 1
o = i - n
print(o)


n = int(input())
str = input()
value = 0
i = 0
while i < n - 1:
	if str[i] == str[i + 1]:
		str.replace(str[i], '')
		value += 1
	i += 1
print(value)


class MiniStones:

	def solve(self, n, color):
		count = 0
		for i in range(1, n):
			if color[i - 1] == color[i]:
				count += 1
		return count
n = int(input())
color = input()
ministones = MiniStones()
print(ministones.solve(n, color))


x = input()
y = input()
count = 0
count2 = 0
count3 = 0
answer = 0
for xs in y:
	if xs in 'R':
		count = count + 1
		if count == 2:
			answer = answer + 1
			count = 1
	else:
		count = 0
	if xs in 'G':
		count2 = count2 + 1
		if count2 == 2:
			answer = answer + 1
			count2 = 1
	else:
		count2 = 0
	if xs in 'B':
		count3 = count3 + 1
		if count3 == 2:
			answer = answer + 1
			count3 = 1
	else:
		count3 = 0
print(answer)


n = int(input())
a = list(input())
for i in range(n - 1):
	j = i + 1
	while j < n and a[i] == a[j]:
		a[j] = '0'
		j = j + 1
print(str(a.count('0')))


a = int(input())
b = input()
c = b[0]
ans = 0
e = 0
for i in range(1, a):
	if b[i] == c:
		ans += 1
	else:
		c = b[i]
print(ans)


(i, a) = (0, int(input()))
b = list(input())
for x in range(a - 1):
	if b[i] == b[i + 1]:
		b.remove(b[i])
	else:
		i = i + 1
print(a - i - 1)


a = int(input())
b = input()
sum = 0
j = 0
k = 1
if a == 1:
	print(0)
else:
	for i in range(a - 1):
		if b[j] == b[k]:
			sum = sum + 1
			k = k + 1
		else:
			j = k
			k = k + 1
	print(sum)


a = input()
words = list(input())
x = 0
i = 0
while i <= len(words) - 2:
	if words[i] == words[i + 1]:
		x = x + 1
	else:
		x = x
	i = i + 1
print(x)


n = int(input())
a = str(input())
c = 0
x = 0
while c <= len(a) - 2:
	if a[c] == a[c + 1]:
		x = x + 1
	c = c + 1
print(x)


def main():
	n = int(input())
	a = [i for i in input()]
	k = 0
	i = 0
	while i < len(a) - 1:
		if a[i] == a[i + 1]:
			k += 1
			a.pop(i + 1)
		else:
			i += 1
	print(k)
main()


N = int(input())
col = list(input())
count = 0
for i in range(N - 1):
	if col[i] == col[i + 1]:
		count += 1
	else:
		continue
print(count)


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


n = int(input())
l = [x for x in input().rstrip()]
c = 0
for i in range(1, n):
	if l[i - 1] == l[i]:
		c += 1
print(c)


n = int(input())
string = input()
l = []
l.append(string[0])
for i in string:
	if i != l[-1]:
		l.append(i)
a = len(l)
print(n - a)


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


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


n = input()
s = input()
l = list()
c = 0
for i in s:
	l.append(i)
for j in range(len(l) - 1):
	if l[j] == l[j + 1]:
		c = c + 1
	j = j + 1
print(c)


n = int(input())
string = input()
srt = []
new_str = []
for i in string:
	srt.append(i)
for i in range(n):
	if i == 0:
		new_str.append(srt[i])
	elif srt[i] != new_str[-1]:
		new_str.append(srt[i])
	else:
		pass
print(len(srt) - len(new_str))


num = int(input())
str = input()[:num]
numc = 0
for i in range(num - 1):
	if str[i] == str[i + 1]:
		numc += 1
print(numc)


inLen = int(input())
inStr = input()
res = inStr[0]
count = 0
for i in range(1, inLen):
	if res == inStr[i]:
		count += 1
		continue
	res = inStr[i]
print(count)


n = int(input())
st = str(input())
k = 0
for i in range(len(st) - 1):
	if st[i] == st[i + 1]:
		k += 1
	else:
		continue
print(k)


n = int(input())
nom = ''
l = []
i = 0
j = 1
if len(nom) <= n:
	nom = input()
while (i < n - 1) & (j == i + 1):
	if nom[i] == nom[j]:
		l.append(i)
	i += 1
	j += 1
print(len(l))


a = int(input())
b = input()
c = b[0]
n = 0
for i in range(a):
	d = c
	c = b[i]
	if i == 0:
		pass
	elif d == c:
		n += 1
print(n)


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


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

def good(s):
	if len(s) == 0:
		return (True, 0)
	for i in range(len(s) - 1):
		if s[i] == s[i + 1]:
			return (False, i)
	return (True, 0)
c = 0
while True:
	(ans, index) = good(a)
	if ans:
		print(c)
		break
	else:
		a = a[:index] + a[index + 1:]
		c += 1


from sys import stdin
N = int(stdin.readline())
string = stdin.readline()
diff = [ord(string[i]) - ord(string[i + 1]) for i in range(N - 1)]
print(diff.count(0))


n = int(input())
s = input()
l = list(s)
c = 0
i = 0
while i < len(l) - 1:
	if l[i] == l[i + 1]:
		del l[i]
		c += 1
		i = 0
	else:
		i = i + 1
print(c)


def task1():
	(n, m) = map(int, input().split())
	a = [int(i) for i in input().split()]
	passed = a[m - 1]
	ans = 0
	for score in a:
		if score >= passed and score > 0:
			ans += 1
	print(ans)

def task2():
	vowels = 'aoeuyi'
	a = input().lower()
	b = []
	for symbol in a:
		if symbol not in vowels:
			b.append(symbol)
	print('.' + '.'.join(b))

def task3():
	n = int(input())
	a = input()
	ans = 0
	prev = '\n'
	for symb in a:
		if prev == symb:
			ans += 1
		prev = symb
	print(ans)
task3()


import re
import sys

def solve(input_stream, output_stream):
	stone_sequence = input_stream.readlines()[1].rstrip()
	stone_groups = re.findall('R+|G+|B+', stone_sequence)
	output_stream.write(str(len(stone_sequence) - len(stone_groups)))
solve(sys.stdin, sys.stdout)


stone_count = int(input())
color_set = input()
key = color_set[0]
count = 0
for i in range(1, stone_count):
	if color_set[i] == key:
		count += 1
	else:
		key = color_set[i]
print(count)


import sys

def Stones():
	input()
	a = input()
	result = len(a)
	for i in range(0, len(a) - 1):
		if a[i] == a[i + 1]:
			result -= 1
	print(len(a) - result)
Stones()


import sys
inp = sys.stdin.read().split('\n')
n = int(inp[0])
s = inp[1]
through = False
count = 0
s1 = ''
while s != s1:
	s1 = s
	for x in range(0, len(s) - 1):
		if s[x] == s[x + 1]:
			s = s[:x] + s[x + 1:]
			count += 1
			break
	else:
		break
	continue
print(count)


input()
x = input()
array = []
for char in x:
	array.append(char)
count = 0
var = 0
for x in range(0, len(array) - 1):
	if array[x] == array[x + 1]:
		count = count + 1
print(count)


tam = int(input())
string = input()
resposta = 0
i = 1
atual = 0
while i < tam:
	if string[atual] == string[i]:
		resposta = resposta + 1
		i = i + 1
	elif string[atual] != string[i]:
		atual = i
		i = i + 1
print(resposta)


(p, j) = (input(), 0)
i = input()
for k in range(len(i) - 1):
	if i[k] == i[k + 1]:
		j += 1
print(str(j))


a = int(input())
str1 = input()
lst = list(str1)
lst1 = []
k = 0
while k < a - 1:
	if lst[k] == lst[k + 1]:
		lst1.append(lst[k + 1])
	k += 1
print(len(lst1))


length = input()
word = input()
counter = 0
for i in range(len(word) - 1):
	if word[i] == word[i + 1]:
		counter += 1
print(counter)


import math
import re
s = input()
s = input()
l = len(s)
s = re.sub('[R]+', 'R', s)
s = re.sub('[G]+', 'G', s)
s = re.sub('[B]+', 'B', s)
print(l - len(s))


a = int(input())
mas = list(input())
n = mas[0]
h = 0
for i in range(1, a):
	if n == mas[i]:
		h += 1
		n = mas[i]
	else:
		n = mas[i]
print(h)


import sys
total = sys.stdin.readline().rstrip('\n')
rocks = sys.stdin.readline().rstrip('\n')
rocks = list(rocks)
counter = 0
i = 0
while i < len(rocks) - 1:
	while i < len(rocks) - 1 and rocks[i] == rocks[i + 1]:
		del rocks[i + 1]
		counter += 1
	i += 1
print(counter)


x = int(input())
y = list(input())
k = len(y)
count = 0
for i in range(k - 1):
	if y[i] == y[i + 1]:
		count += 1
print(count)


from itertools import groupby
length = int(input())
row = input()
groupcount = 0
for (k, g) in groupby(row):
	groupcount += 1
print(length - groupcount)


x = eval(input())
l = input()
i = c = 0
while i < len(l) - 1:
	if l[i] == l[i + 1]:
		c += 1
	i += 1
print(c)


n = int(input())
arr = list(input())
i = 0
k = 0
while True:
	for j in range(len(arr) - 1):
		if arr[j] == arr[j + 1]:
			del arr[j]
			k += 1
			break
	else:
		break
print(k)


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


n = int(input())
stones = [c for c in input()]
result = []
if len(stones):
	result.append(stones[0])
for i in range(1, len(stones)):
	if stones[i] != stones[i - 1]:
		result.append(stones[i])
print(len(stones) - len(result))


n = int(input())
colors = input()
counter = 0
for x in range(n - 1):
	if colors[x] == colors[x + 1]:
		counter += 1
print(counter)


n = int(input())
stones = str(input())
move = 0
for i in range(1, len(stones)):
	if stones[i] == stones[i - 1]:
		move += 1
	else:
		move += 0
print(move)


n = int(input())
str = input()
ls = [str[0]]
for i in range(1, len(str)):
	if str[i] != str[i - 1]:
		ls.append(str[i])
print(n - len(ls))


s = int(input())
p = input()
a = list(p)
s = len(p)
q = []
T = ''
for i in range(s - 1):
	if a[i] == a[i + 1]:
		q += a[i]
for i in q:
	a.remove(i)
for i in a:
	T += i
C = len(T)
o = s - C
print(o)


n = int(input())
a = list(input())
s = [a[0]]
ans = 0
for j in range(1, n):
	s.append(a[j])
	if s[-1] == s[-2]:
		s.pop(-1)
		ans += 1
print(ans)


def split(word):
	return [char for char in word]
count = 0
n = input()
word = input()
l = split(word)
for i in range(len(l) - 1):
	if l[i] == l[i + 1]:
		count += 1
print(count)


remove = 0
count = int(input())
x = input()
for number in range(1, count):
	if x[number - 1] == x[number]:
		remove += 1
		number = 0
	else:
		continue
print(remove)


n = input()
s = input()
s = list(s)
omit = 0
a = 0
b = 1
while b < len(s):
	if s[a] == s[b]:
		omit += 1
		s.remove(s[b])
	else:
		a += 1
		b += 1
print(omit)


n = input()
table = input()
temp = 0
number = 0
while temp < len(table) - 1:
	if table[temp] == table[temp + 1]:
		number += 1
		table = table[:temp] + table[temp + 1:]
		temp = -1
	temp += 1
print(number)


n = int(input())
s = str(input())
l = list(s)
j = []
for i in range(len(l) - 1):
	if l[i] == l[i + 1]:
		j.append(l[i + 1])
print(len(j))


N = int(input())
a = input().strip()
count = 0
for i in range(len(a) - 1):
	if a[i] == a[i + 1]:
		count += 1
print(count)


input()
str = input()
print(sum((x == y for (x, y) in zip(str, str[1:]))))


n = input()
type(n)
colours = input()
type(colours)
n = int(n)
colours = list(colours)
r = 0
for x in range(len(colours) - 1):
	if colours[x] == colours[x + 1]:
		r += 1
print(r)


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


number = int(input())
stones = str(input())
count = 0
for i in range(len(stones) - 1):
	if stones[i] == stones[i + 1]:
		count = count + 1
	else:
		continue
print(count)


n = int(input())
ws = input()
stack = []
for i in range(n - 1):
	if ws[i] == ws[i + 1]:
		stack.append(ws[i])
print(len(stack))


d = int(input())
n = str(input())
c = 0
for i in range(len(n) - 1):
	if n[i] == n[i + 1]:
		c += 1
print(c)


n = int(input())
stones = input()
a = 0
while True:
	for x in range(n - 1):
		if stones[x] == stones[x + 1]:
			stones = stones[:x] + stones[x + 1:]
			n -= 1
			a += 1
			break
	else:
		break
print(a)


import io
import os
n = int(input())
c = input()
ans = 0
for i in range(len(c) - 1):
	if c[i] == c[i + 1]:
		ans += 1
print(ans)


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


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


def main():
	n = int(input())
	c = input()
	t = 0
	anterior = 0
	for piedra in c:
		if piedra == anterior:
			t += 1
		anterior = piedra
	print(t)
main()


import sys
n = int(input())
s = list(input())
ans = 0
i = 1
if n == 1:
	print(0)
	sys.exit()
while True:
	if len(s) == 1 or i == len(s) - 1:
		break
	if s[i] == s[i - 1]:
		del s[i]
		ans += 1
	else:
		i += 1
if s[len(s) - 1] == s[len(s) - 2]:
	ans += 1
print(ans)


n = int(input())
stones = input()
count = 0
for i in range(0, n):
	if 2 * 'R' in stones:
		stones = list(stones)
		for j in range(len(stones)):
			if stones[j] == 'R' and stones[j + 1] == 'R':
				del stones[j]
				break
		count = count + 1
		stones = ''.join(stones)
	elif 2 * 'G' in stones:
		stones = list(stones)
		for j in range(len(stones)):
			if stones[j] == 'G' and stones[j + 1] == 'G':
				del stones[j]
				break
		count = count + 1
		stones = ''.join(stones)
	elif 2 * 'B' in stones:
		stones = list(stones)
		for j in range(len(stones)):
			if stones[j] == 'B' and stones[j + 1] == 'B':
				del stones[j]
				break
		count = count + 1
		stones = ''.join(stones)
print(count)


def main():
	n = int(input())
	stones = input()
	numberNeighboor = 0
	for i in range(1, n):
		neighboor = stones[i - 1] + stones[i]
		if neighboor == 'RR' or neighboor == 'BB' or neighboor == 'GG':
			numberNeighboor += 1
	print(numberNeighboor)
main()


numberOfStones = int(input())
stone_color = input()
count = 0
for i in range(numberOfStones - 1):
	if stone_color[i] == stone_color[i + 1]:
		count += 1
print(count)


def main():
	n = int(input())
	s = str(input())
	count = 0
	for i in range(len(s)):
		try:
			if s[i] == s[i + 1]:
				count += 1
		except:
			pass
	print(count)
if __name__ == main():
	main()


a = int(input())
x = 0
s = input()
s = s.replace('R', '1')
s = s.replace('G', '2')
s = s.replace('B', '3')
for i in range(len(s) - 1):
	if i < len(s):
		if int(s[i]) == int(s[i + 1]):
			x = x + 1
if x == a:
	x = x - 1
print(x)


useless = input()

def shouldRemove(rocks):
	last = ''
	remove = 0
	for rock in rocks:
		if last == rock:
			remove += 1
		last = rock
	return remove
print(shouldRemove(input()))


def ans(a, ref):
	count = 0
	for i in range(3):
		while a.find(ref[i]) >= 0:
			index = a.find(ref[i])
			count += 1
			a = a[:index] + a[index + 1:]
	return count
ref = ['RR', 'GG', 'BB']
i = input()
txt = input()
print(ans(txt, ref))


n = int(input())
cnt = 0
s = input()
t = s[0]
for i in s[1:]:
	if t == i:
		cnt += 1
	t = i
print(cnt)


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


n = int(input())
seq = list(input())
zipped = zip(seq, seq[1:])
n_stones = len([z for z in zipped if z[0] == z[1]])
print(n_stones)


n = int(input())
s = input()
li = list(s)
s2 = []
k = 0
for i in range(len(li) - 1):
	if s[k] == s[k + 1]:
		s2.append(s[k + 1])
	else:
		pass
	k += 1
print(len(s2))


n = int(input())
s = input()
res = 0
z = ''
for x in s:
	if z == x:
		res += 1
	else:
		z = x
print(res)


t = int(input())
k = input()
red = 0
green = 0
blue = 0
remove = 0
for i in k:
	if i == 'R':
		red = red + 1
		blue = 0
		green = 0
		if red > 1:
			remove = remove + 1
	elif i == 'G':
		red = 0
		blue = 0
		green = green + 1
		if green > 1:
			remove = remove + 1
	elif i == 'B':
		red = 0
		blue = blue + 1
		green = 0
		if blue > 1:
			remove = remove + 1
print(remove)


num = input()
colour = input()
f = 0
for i in range(int(num)):
	if int(num) > 1:
		if i == 0:
			if colour[i] == colour[i + 1]:
				f = f + 1
				continue
		if 0 < i < len(colour) - 1:
			if colour[i] == colour[i + 1]:
				f = f + 1
print(f)


number = int(input())
string = str(input())
result = list(string)
flag = 0
for (x, y) in zip(result, result[1:]):
	if x == y:
		flag = flag + 1
print(flag)


n = int(input())
s = input()
color = s[0]
stones = 0
for i in s[1:]:
	if i == color:
		stones += 1
	else:
		color = i
print(stones)


n = int(input(''))
stones = input('')
last = None
to_remove = 0
for stone in stones:
	if last == stone:
		to_remove += 1
	else:
		last = stone
print(to_remove)


n = int(input())
stones = list(input())
print(sum([stones[i] == stones[i - 1] for i in range(1, n)]))


n = int(input())
s = [x for x in input()]
i = 1
count = 0
while i < len(s):
	if s[i] == s[i - 1]:
		s.pop(i)
		count += 1
	else:
		i += 1
print(count)


n = int(input())
s = input()
a = 0
for i in range(len(s)):
	if i == len(s) - 1:
		break
	elif s[i] == 'R' and s[i + 1] == 'R':
		a += 1
	elif s[i] == 'G' and s[i + 1] == 'G':
		a += 1
	elif s[i] == 'B' and s[i + 1] == 'B':
		a += 1
print(a)


_ = input()
seq = input()
c = ''
length = 0
answer = 0
for char in seq:
	if char == c:
		length += 1
	else:
		if length > 1:
			answer += length - 1
		c = char
		length = 1
if length > 1:
	answer += length - 1
print(answer)


def count_neighbours(s, begin):
	i = begin + 1
	while i < len(s) and s[i] == s[begin]:
		i += 1
	return i - begin - 1
n = int(input())
sss = input()
res = 0
ii = 0
while ii < n:
	cnt = count_neighbours(sss, ii)
	res += cnt
	ii += cnt + 1
print(res)


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


l = 0

def fun(b, l):
	k = 0
	for i in range(len(b) - 1):
		if b[i] == b[i + 1]:
			b.pop(i)
			l = l + 1
			return fun(b, l)
	return l
a = int(input())
b = input()
b = list(b)
f = fun(b, l)
print(f)


n = int(input())
text = input()
previous = text[0]
number_remove = 0
for i in range(1, n):
	current = text[i]
	if previous == current:
		number_remove += 1
	else:
		previous = text[i]
	i += 1
print(number_remove)


n = int(input())
data = input()
last = 'X'
cnt = 0
for c in data:
	if c == last:
		cnt += 1
	else:
		last = c
print(cnt)


n = int(input())
a = []
b = 0
for i in range(1):
	m = input()
for i in range(n):
	a.append(m[i])
for i in range(len(a) - 1):
	if a[i] == a[i + 1]:
		b += 1
print(b)


n = int(input())
s = str(input())
a = []
for word in s:
	a.append(word)
for i in range(0, n - 1):
	if a[i] == a[i + 1]:
		a[i] = '.'
b = []
for i in range(0, n):
	if a[i] != '.':
		b.append(a[i])
s1 = str()
for elem in b:
	s1 += elem
print(len(s) - len(s1))


stoun = int(input())
stoun_ = input()
res = 0
for i in range(1, len(stoun_)):
	if stoun_[i - 1] == stoun_[i]:
		res += 1
print(res)


lent = input()
strn = input()
count = 0
for i in range(len(strn) - 1):
	if strn[i] == strn[i + 1]:
		count = count + 1
print(count)


n = int(input())
rocks = list(input())
counter = 0
current = 0
while True:
	if current + 1 == len(rocks):
		print(counter)
		break
	if rocks[current] == rocks[current + 1]:
		rocks.pop(current + 1)
		counter += 1
	else:
		current = current + 1


tmp = input()
stone = input()
cnt = 0
for x in range(1, len(stone)):
	if stone[x - 1] == stone[x]:
		cnt += 1
print(cnt)


n = int(input())
s = str(input())
arr = list(s)
cnt = 0
for i in range(0, n):
	if n == 1:
		cnt = 0
		break
	elif i == 0 and arr[i] == arr[i + 1]:
		cnt += 1
		arr[i] = '.'
	elif i == n - 1 and arr[i] == arr[i - 1]:
		cnt += 1
		arr[i] = '.'
	elif i != 0 and i != n - 1 and (arr[i] == arr[i + 1] or arr[i] == arr[i - 1]):
		cnt += 1
		arr[i] = '.'
print(cnt)


n = int(input())
r = str(input())
p = 0
tot = ''
if len(r) == n:
	for i in r:
		if tot == i:
			p += 1
		tot = i
print(p)


input()
s = input()
c = 1
for i in range(1, len(s)):
	if s[i] != s[i - 1]:
		c += 1
print(str(len(s) - c))


import sys
input = sys.stdin.readline
n = int(input())
s = list(input().strip())
prev = s[0]
cnt = 0
for c in s[1:]:
	if c == prev:
		cnt += 1
	else:
		prev = c
print(cnt)


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


input_list = []
num = 0
while True:
	if num == 2:
		break
	line = input()
	input_list.append(list(line))
	num += 1
input_list.__delitem__(0)
input_list = input_list[0]
old_len = len(input_list)
count = 0
while True:
	if len(input_list) == 1 or count >= len(input_list) - 1:
		break
	elif input_list[count] == input_list[count + 1] or input_list[count] == input_list[abs(count - 1)]:
		input_list.pop(count)
	else:
		count += 1
print(old_len - len(input_list))


n = int(input())
r = str(input())
c = 0
for i in range(n - 1):
	if r[i] == r[i + 1]:
		c += 1
	else:
		pass
print(c)


def _266A(sequence, n):
	if len(sequence) == 1:
		return n
	if sequence[0] == sequence[1]:
		n = n + 1
	return _266A(sequence[1:], n)
input()
print(_266A(input(), 0))


n = int(input())
string = input()
l = [string[0]]
m = 0
for i in range(1, n):
	if string[i] == l[m]:
		pass
	else:
		l.append(string[i])
		m = m + 1
k = n - m - 1
print(k)


m = int(input())
s = input().strip()
k = 0
i = 1
iOLD = 0
while i < m:
	while s[iOLD] == s[i] and i < m - 1:
		i += 1
		k += 1
	if s[iOLD] == s[i]:
		k += 1
	iOLD = i
	i += 1
print(k)


k = input()
row = input()
count = 0
for i in range(0, int(k) - 1):
	if row[i] == row[i + 1]:
		count += 1
print(count)


import re
input()
stones = input()
result = 0
temp = re.findall('R{2,}|G{2,}|B{2,}', stones)
for item in temp:
	result += len(item) - 1
print(result)


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


def StonesOnTheTable(string, n):
	count = 0
	for i in range(1, n):
		if string[i - 1] == string[i]:
			count += 1
	return count
n = int(input())
word = input()
print(StonesOnTheTable(word, n))


n = int(input())
a = list(input())
for i in range(n - 1):
	if a[i] == a[i + 1]:
		a[i] = ''
b = ''.join(a)
print(n - len(b))


input()
s = [c for c in input()]
n = len(s)
i = 0
while len(s) > 0 and i < len(s) - 1:
	while i < len(s) - 1 and s[i] == s[i + 1]:
		s.pop(i + 1)
	i += 1
print(n - len(s))


l = int(input())
inp = list(input())
p = inp[0]
c = ''
n = 0
for i in range(l):
	if i == 0:
		continue
	c = inp[i]
	if c == p:
		n += 1
	else:
		p = c
print(n)


def main():
	n = int(input())
	S = input().rstrip()
	(ans, cur) = (0, S[0])
	for i in S[1:]:
		if i != cur:
			cur = i
		else:
			ans += 1
	print(ans)
main()


n = int(input())
string = input()
first_len = len(string)
while True:
	restart = False
	for i in range(1, len(string)):
		if string[i] == string[i - 1]:
			string = string[:i] + string[i + 1:]
			restart = True
			break
	if restart:
		continue
	else:
		break
print(first_len - len(string))


A = input()
N = input()
s = list(N)
capacity = 0
for i in range(0, len(s) - 1):
	if i == len(s) - 1:
		break
	elif s[i] == s[i + 1]:
		capacity += 1
print(capacity)


n = int(input())
s = list(input())
m = 0
for f in range(len(s) - 1):
	if s[f] == s[f + 1]:
		m += 1
print(m)


(n, s, i, k) = (int(input()), input(), 1, 0)
s = list(s)
while i < len(s) - 1 and len(s) > 2:
	if s[i] == s[i - 1] or s[i] == s[i + 1]:
		del s[i]
		i -= 1
		k += 1
	i += 1
if len(s) != 1:
	if s[0] == s[1]:
		del s[1]
		k += 1
print(k)


n = int(input())
s = input()
j = len(s) - 1
cnt = 0
while j >= 1:
	if s[j] != s[j - 1]:
		j -= 1
	else:
		cnt += 1
		j -= 1
print(cnt)


n = int(input())
sequsnce = input()
new = '-'
for i in sequsnce:
	if i != new[-1]:
		new += i
new = new[1:]
print(n - len(new))


input()
a = input()
prev = a[0]
count = 0
for i in a[1:]:
	if prev == i:
		count += 1
	else:
		prev = i
print(count)


n = int(input())
row = list(input())
i = 0
count = 0
while i != len(row) - 1:
	if row[i] != row[i + 1]:
		i += 1
	else:
		count += 1
		row.pop(i)
print(count)


def take(letras):
	contador = 0
	for i in range(1, len(letras)):
		if letras[i - 1] == letras[i]:
			contador += 1
	return contador
n = input()
string = input()
print(take(string))


a = 0
sa = int(input())
string = input()
for x in range(sa - 1):
	if string[x] == string[x + 1]:
		a += 1
print(a)


n = int(input())
color = input()
N = len(color)
t = 0
for i in range(N - 1):
	s = color[i]
	S = color[i + 1]
	if i != 0:
		if s == S:
			colors = colors[0:i] + colors[i + 1:]
			t += 1
	elif s == S:
		colors = color[i + 1:]
		t += 1
	else:
		colors = color
print(t)


n = input()
s = input()
l = len(s)
cnt = 0
i = 0
while i < l:
	cnt += 1
	while i + 1 <= l - 1 and s[i] == s[i + 1]:
		i += 1
	i += 1
print(l - cnt)


n = int(input())
s = input()
ls = None
cnt = 0
for e in s:
	if e == ls:
		cnt = cnt + 1
	else:
		ls = e
print(cnt)


n = int(input(''))
x = input('')
ch = 0
for i in range(len(x)):
	if i == 0:
		pass
	elif x[i] == x[i - 1]:
		ch += 1
print(ch)


n = int(input())
str1 = input()
list1 = [x for x in str1]
str2 = ''
x = 0
for x in range(n - 1):
	if list1[x] == list1[x + 1]:
		str2 += list1[x]
print(len(str2))


n = int(input())
st = input()
c = st[0]
ct = 0
for i in st[1:]:
	if i != c:
		c = i
	else:
		ct += 1
print(ct)


from math import *
n = int(input())
s = input()
l = 0
for i in range(1, n):
	if s[i] == s[i - 1]:
		l += 1
print(l)


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


num = int(input())
stone = input()
(remove, i) = (0, 0)
while i < num - 1:
	if stone[i] == stone[i + 1]:
		remove += 1
	i += 1
print(remove)


n = int(input())
letters = list(input())
count = 0
for i in range(n):
	if i == 0:
		continue
	elif letters[i] == letters[i - 1]:
		count += 1
print(count)


import sys
n = int(sys.stdin.readline())
inputs = sys.stdin.readline().strip()
mini = 0
cmpColor = ''
for i in range(n):
	currentColor = inputs[i]
	if currentColor == cmpColor:
		mini += 1
	else:
		cmpColor = currentColor
print(mini)


stonesCount = int(input())
stonesColors = input()
currentColor = stonesColors[0]
result = 0
for i in range(1, len(stonesColors)):
	if currentColor == stonesColors[i]:
		result += 1
	else:
		currentColor = stonesColors[i]
print(result)


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


n = int(input())
l = list(input())
cur = l[0]
ans = 0
for c in l[1:]:
	if c == cur:
		ans += 1
	else:
		cur = c
print(ans)


n = int(input())
s = list(input())
deletions = 0
point1 = 0
point2 = 1
while point2 < n:
	if s[point1] == s[point2]:
		deletions += 1
	point1 += 1
	point2 += 1
print(deletions)


from sys import stdin
_ = stdin.readline()
r = 0
p = ''
for l in stdin.readline()[:-1]:
	if p == l:
		r += 1
	p = l
print(r)


m = input()
n = input()
count = 0
for c in range(len(n) - 1):
	if n[c] == n[c + 1]:
		count += 1
print(count)


def rocks():
	a = int(input())
	color = input().strip()
	cnt = 0
	for i in range(a - 1):
		if color[i] == color[i + 1]:
			cnt += 1
	print(cnt)
rocks()


def main():
	n = int(input())
	st = input()
	x = ''
	y = 0
	for i in range(len(st) - 1):
		if st[i] == st[i + 1]:
			y += 1
	print(y)
main()


n = int(input())
s = input()
prev = None
ans = 0
for x in s:
	if x == prev:
		ans += 1
	prev = x
print(ans)


x = input()
y = input()
z = []
e = 0
a = 0
c = 0
for i in y:
	z.append(i)
while e < len(z) - 1:
	if z[e] == z[e + 1]:
		c = c + 1
	e = e + 1
print(c)


def Convert(string):
	list1 = []
	list1[:0] = string
	return list1
n = int(input())
s = str(input())
l = Convert(s)
ans = 0
pnter = l.pop(0)
while len(l) > 0:
	if pnter == l[0]:
		l.pop(0)
		ans += 1
	else:
		pnter = l.pop(0)
print(ans)


from itertools import groupby
n = int(input())
s = list(input())
print(n - len(list(groupby(s))))


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


n = int(input())
k = 0
while k < 1:
	x = input()
	k += 1
A = x
V = 0
for i in range(0, len(A) - 1):
	if A[i] == A[i + 1]:
		V += 1
	else:
		V += 0
print(V)


import re
import sys
from bisect import bisect, bisect_left, insort, insort_left
from collections import Counter, defaultdict, deque
from copy import deepcopy
from decimal import Decimal
from itertools import accumulate, combinations, combinations_with_replacement, groupby, permutations, product
from math import acos, asin, atan, ceil, cos, degrees, factorial, gcd, hypot, log2, pi, radians, sin, sqrt, tan
from operator import itemgetter, mul
from string import ascii_lowercase, ascii_uppercase, digits

def inp():
	return int(input())

def inlist():
	return list(map(int, input().split()))

def instr():
	s = input()
	return list(s[:len(s)])

def invr():
	return map(int, input().split())
n = inp()
s = instr()
c = 0
for i in range(n):
	if s[i] == '-1':
		continue
	if i > 0 and s[i] == s[i - 1]:
		s[i] = '-1'
		c += 1
	if i + 1 < n:
		if s[i] == s[i + 1]:
			c += 1
			s[i] = '-1'
print(c)


n = int(input())
stones = input()
numDoubles = 0
lastChar = '_'
for x in stones:
	if x == lastChar:
		numDoubles += 1
	lastChar = x
print(numDoubles)


n = int(input())
colour_code = input()
colour_list = []

def main():
	for index in range(n):
		if index == 0:
			colour_list.append(colour_code[index])
		elif colour_code[index] != colour_list[-1]:
			colour_list.append(colour_code[index])
	new_colour_code = ''.join(colour_list)
	print(len(colour_code) - len(new_colour_code))
if __name__ == '__main__' and n <= 50 and (len(colour_code) == n):
	main()


n = int(input())
s = input()
res = ''
j = 0
for i in range(n):
	if res == '' or res[j - 1] != s[i]:
		res += s[i]
		j += 1
print(n - j)


from itertools import groupby
input()
s = input().rstrip()
print(len(s) - len(''.join((k for (k, _) in groupby(s)))))


n = input()
s = str(input())
m = 0
same = False
last_c = ''
for c in s:
	if c == last_c:
		m += 1
	last_c = c
print(m)


from sys import stdin
n = int(stdin.readline())
s = stdin.readline().rstrip()
prev = s[0]
count = 0
for i in range(1, n):
	if s[i] == prev:
		count += 1
	else:
		prev = s[i]
print(count)


a = int(input())
b = input()
c = str()
for i in range(a - 1):
	if b[i] == b[i + 1]:
		pass
	else:
		c = c + b[i]
c = c + b[-1]
print(a - len(c))


n = int(input())
string = list(input())
resultado = 0
for i in range(n - 1):
	if string[i] == string[i + 1]:
		resultado += 1
print(resultado)


def main():
	stoneCount = int(input())
	stones = input()
	removalCount = 0
	for i in range(1, stoneCount):
		if stones[i] == stones[i - 1]:
			removalCount += 1
	print(removalCount)
main()


import sys
n = int(input())
stones = input()
to_remove = 0
neighbours = 1
left_stone = stones[0]
for i in range(1, n):
	if stones[i] == left_stone:
		neighbours += 1
	else:
		if neighbours >= 2:
			to_remove += neighbours - 1
		neighbours = 1
	left_stone = stones[i]
if neighbours >= 2:
	to_remove += neighbours - 1
print(to_remove)


n = int(input())
s = input()
ch = 'a'
o = 0
for i in range(n):
	if s[i] != ch:
		o += 1
		ch = s[i]
print(n - o)


n = int(input())
s = input()
current = s[0]
length = 0
for i in s[1:]:
	if i == current:
		length += 1
	else:
		current = i
print(length)


n = int(input())
s = [str(i) for i in input()]
count = 0
try:
	for i in range(len(s)):
		if ord(s[i]) == ord(s[i + 1]):
			count += 1
except:
	pass
print(count)


qnt = int(input())
p = input()
new = list()
for w in p:
	if not new:
		new.append(w)
	elif new[-1] != w:
		new.append(w)
print(len(p) - len(new))


le = int(input())
input_value = input()
count = 0
for i in range(le - 1):
	if input_value[i] == input_value[i + 1]:
		count += 1
print(count)


q = int(input())
s = input()
while True:
	before = s
	for letter in 'RGB':
		s = s.replace(letter * 2, letter)
	if s == before:
		break
print(q - len(s))


n = int(input().strip())
x = list(input().rstrip())
c = 0
for i in range(n - 1):
	if x[i] == x[i + 1]:
		c = c + 1
	elif len(set(x[i:])) == len(x[i:]):
		break
print(c)


n = int(input())
s = list(input())
_ = 0
c = 0
while _ < n - 1:
	if s[_] == s[_ + 1]:
		c += 1
	_ += 1
print(c)


n = int(input())
s = input()
q = [s[0]]
i = 1
c = 0
while i < n:
	if len(q) and q[-1] == s[i]:
		while len(q) and q[-1] == s[i]:
			c += 1
			q.pop()
	q.append(s[i])
	i += 1
print(c)


n = int(input().rstrip())
text = list(input().rstrip())
count = 0
for i in range(1, n):
	if text[i - 1] == text[i]:
		count += 1
print(count)


Max = 0
K = 0
n = int(input())
st1 = input()
for j in range(3):
	for i in range(len(st1) - 1):
		if st1[i] == st1[i + 1]:
			K += 1
	if K > Max:
		Max = K
	K = 0
print(Max)


number = int(input())
text = input()
count = 0
for i in range(len(text) - 1):
	if text[i] == text[i + 1]:
		count += 1
		i += 1
print(count)


n = int(input())
s = input()
a = 0
for i in range(n):
	if i == n - 1:
		pass
	elif s[i] != s[i + 1]:
		pass
	else:
		a += 1
print(a)


cnt1 = input()
str1 = input()
cnt = 0
for s in range(len(str1) - 1):
	if str1[s] == str1[s + 1]:
		cnt += 1
print(cnt)


num = input()
num = int(num)
line = input()
temp = line[0]
flag = 0
for i in range(1, num):
	if line[i] == temp:
		flag += 1
	else:
		temp = line[i]
print(flag)


n = int(input())
s = input()
row = []
cnt = 0
for i in range(n):
	row.append(s[i])
for j in range(n - 1):
	if row[j] == row[j + 1]:
		cnt = cnt + 1
print(cnt)


n = int(input())
inputs = input()
outputs = 0
pivot = inputs[0]
for i in range(1, n):
	if inputs[i] == pivot:
		outputs += 1
	else:
		pivot = inputs[i]
print(outputs)


N = input()
St = input()
List = []
for i in St:
	List.append(i)
n = 0
for s in range(int(N)):
	if s != int(N) - 1:
		if List[s] == List[s + 1]:
			n += 1
print(n)


k = int(input())
n = input()
answer = 0
prev = n[0]
for i in range(1, k):
	if n[i] == prev:
		answer += 1
	else:
		prev = n[i]
print(answer)


n = int(input())
str = list(input())
c = 0
for i in range(n):
	if i < n - 1 and str[i] == str[i + 1]:
		c += 1
print(c)


num = input()
col = input()
done = False
counter = 0
col = list(col)
while done == False:
	done = True
	for i in range(int(num)):
		try:
			if col[i] == col[i + 1]:
				col.pop(i)
				counter = int(counter + 1)
				done = False
				break
		except:
			pass
print(counter)


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


n1 = input()
n = int(n1)
s = input()
output = 0
myDictionary = {}
for i in range(0, n):
	myDictionary[i] = s[i:i + 1:1]
L = len(myDictionary)
if n > 1:
	j = 0
	while j < L:
		if myDictionary.get(j) == myDictionary.get(j + 1):
			output += 1
		myDictionary.pop(j)
		j += 1
print(output)


num = int(input())
x = ['none'] * num
X = input()
y = 0
for i in range(num):
	x[i] = X[i]
for i in range(num - 1):
	if x[i] == x[i + 1]:
		y += 1
if y == num:
	y -= 1
print(y)


N = int(input())
string = str(input())
k = 0
count = 0
while k < len(string) - 1:
	if string[k] == string[k + 1]:
		count = count + 1
		k = k + 1
	else:
		k = k + 1
print(count)


n = int(input())
stones = list(input())
result = 0
index = 1
while n > index:
	if stones[index] == stones[index - 1]:
		result += 1
	if result == n:
		result -= 1
		break
	index += 1
print(result)


n = input()
stones = input()
cnt = 0
cur = stones[0]
for i in range(1, len(stones)):
	if stones[i] != cur:
		cur = stones[i]
	else:
		cnt += 1
print(cnt)


def problem():
	n = int(input())
	colors = input()
	anterior = colors[0]
	count = 0
	for i in range(1, n):
		nuevito = colors[i]
		if nuevito == anterior:
			count += 1
		anterior = nuevito
	return count
print(problem())


import sys
n = int(sys.stdin.readline().strip())
line = sys.stdin.readline().strip()
if n == 1:
	print(0)
	exit()
result = 0
for i in range(1, n):
	if line[i] == line[i - 1]:
		result += 1
print(result)


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


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


import sys

def gets():
	return sys.stdin.readline().strip()

def get():
	return int(sys.stdin.readline().strip())

def geti():
	return map(int, sys.stdin.readline().strip().split())

def getli():
	return list(map(int, sys.stdin.readline().strip().split()))
n = get()
s = gets()
c = 0
for i in range(n - 1):
	if s[i] == s[i + 1]:
		c += 1
print(c)


number = int(input())
colors = input()
color = list(colors)
x = 0
answer = 0
while x < number - 1:
	if color[x] == color[x + 1]:
		answer = answer + 1
	x = x + 1
print(answer)


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


n = int(input()) - 1
s = list(input())
counter = 0
i = 0
while i < n:
	if s[i] == s[i + 1]:
		counter += 1
		del s[i + 1]
		n -= 1
	else:
		i += 1
print(counter)


n = int(input())
l = input()
k = 0
o = 0
while k != len(l) - 1:
	if l[k + 1] == l[k]:
		o = o + 1
	k = k + 1
print(o)


A = int(input())
C = input()
C = list(C)
C.append('.')
suma = 0
for k in range(A):
	if C[k] == C[k + 1]:
		suma += 1
print(suma)


n = int(input())
stones = list(input())
l = len(stones)
a = 1
while a < l:
	if stones[a - 1] == stones[a]:
		del stones[a]
		a = a
		l -= 1
	else:
		a += 1
print(n - len(stones))


y = int(input())
z = input()
prev = z[0]
count = 0
if len(z) > 1:
	for i in range(len(z) - 1):
		if z[i + 1] == prev:
			count += 1
		else:
			prev = z[i + 1]
else:
	None
print(count)


n = input()
characters = input()
count = 0
prevChar = characters[0]
for letter in characters[1:]:
	nextChar = letter
	if nextChar == prevChar:
		count += 1
	else:
		prevChar = nextChar
print(count)


res = 0
N = int(input())
inputString = input()
last = inputString[0]
for i in range(1, len(inputString)):
	if last == inputString[i]:
		res += 1
	else:
		last = inputString[i]
print(res)


n = int(input())
stones = input()
counter = 0
listt = [stones[0]]
for i in range(1, len(stones)):
	if stones[i] != listt[i - 1]:
		listt.append(stones[i])
	else:
		counter += 1
		listt.append(stones[i])
print(counter)


qnt = int(input())
p = input()
new = list()
new.append(p[0])
for (i, w) in enumerate(p):
	if i != 0:
		if new[-1] != w:
			new.append(w)
print(len(p) - len(new))


k = int(input())
a = list(input())
count = 0
for i in range(len(a) - 1):
	if a[i] == a[i + 1]:
		count += 1
print(count)