n = int(eval(input()))

s = eval(input())



ans = 0

prev = ''

for si in s:

    if prev == si:

        continue

    else:

        ans += 1

        prev = si



print(ans)
n = int(eval(input()))

s = eval(input())



ans = 0

prev = ''

for si in s:

    if prev == si:

        continue

    ans += 1

    prev = si



print(ans)
n = int(eval(input()))
s = eval(input())
ans = 0
prev = ""
for si in s:
    if prev == si:
        continue
    else:
        ans += 1
        prev = si
print(ans)

n = int(eval(input()))
s = eval(input())
ans = 0
prev = ""
for si in s:
    if prev == si:
        continue
    ans += 1
    prev = si
print(ans)

-    else: -        ans += 1 -        prev = si +    ans += 1 +    prev = si