n = int(eval(input()))

s = eval(input())+"?"



ans = 0

now = "?"

for i in range(n+1):

    if i == 0:

        now = s[i]

        continue



    if s[i] == now:

        continue

    else:

        ans += 1

        now = s[i]



print(ans)

N = int(eval(input()))

S = eval(input())

now = "?"



ans = N

for s in S:

    if s == now:

        ans -= 1

        continue

    else:

        now = s



print(ans)

n = int(eval(input()))
s = eval(input()) + "?"
ans = 0
now = "?"
for i in range(n + 1):
    if i == 0:
        now = s[i]
        continue
    if s[i] == now:
        continue
    else:
        ans += 1
        now = s[i]
print(ans)

N = int(eval(input()))
S = eval(input())
now = "?"
ans = N
for s in S:
    if s == now:
        ans -= 1
        continue
    else:
        now = s
print(ans)

-n = int(eval(input())) -s = eval(input()) + "?" -ans = 0 +N = int(eval(input())) +S = eval(input()) -for i in range(n + 1): -    if i == 0: -        now = s[i] -        continue -    if s[i] == now: +ans = N +for s in S: +    if s == now: +        ans -= 1 -        ans += 1 -        now = s[i] +        now = s