N = int(eval(input()))

S = list(eval(input()))



prior = ""

fusion = ""

for i in range(N):

  if prior != S[i]:

    fusion += S[i]

  prior = S[i]

  #print(prior, end="")

print((len(list(fusion))))
N = int(eval(input()))

S = eval(input())

ans = 1

for i in range(1, N):

  if S[i - 1] != S[i]:

    ans += 1

print(ans)
N = int(eval(input()))
S = list(eval(input()))
prior = ""
fusion = ""
for i in range(N):
    if prior != S[i]:
        fusion += S[i]
    prior = S[i]
    # print(prior, end="")
print((len(list(fusion))))

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

-S = list(eval(input())) -prior = "" -fusion = "" -for i in range(N): -    if prior != S[i]: -        fusion += S[i] -    prior = S[i] -    # print(prior, end="") -print((len(list(fusion)))) +S = eval(input()) +ans = 1 +for i in range(1, N): +    if S[i - 1] != S[i]: +        ans += 1 +print(ans)