n = int(eval(input()))

s = eval(input())



count = 1

for i in range(1, n):

    count += (1 if s[i] != s[i-1] else 0)

print(count)

n = int(eval(input()))

s = list(eval(input()))



prev = s[0]

count = 1

for s_i in s[1::]:

    if prev != s_i:

        count += 1

        prev = s_i

print(count)

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

n = int(eval(input()))
s = list(eval(input()))
prev = s[0]
count = 1
for s_i in s[1::]:
    if prev != s_i:
        count += 1
        prev = s_i
print(count)

-s = eval(input()) +s = list(eval(input())) +prev = s[0] -for i in range(1, n): -    count += 1 if s[i] != s[i - 1] else 0 +for s_i in s[1::]: +    if prev != s_i: +        count += 1 +        prev = s_i