n = int(eval(input()))

s = eval(input())

l = []



for i in range(n):

    l.append(s[i])



for i in range(n - 1, 0, -1):

    if l[i] == l[i - 1]:

        del l[i]

print((len(l)))
n = int(eval(input()))

s = eval(input())

ans = 1



for i in range(n - 1):

    if s[i] != s[i + 1]:

        ans += 1



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

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

-l = [] -for i in range(n): -    l.append(s[i]) -for i in range(n - 1, 0, -1): -    if l[i] == l[i - 1]: -        del l[i] -print((len(l))) +ans = 1 +for i in range(n - 1): +    if s[i] != s[i + 1]: +        ans += 1 +print(ans)