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())



ans = 1

temp = s[0]

for c in s:

    if c != temp:

        ans += 1

    temp = c

print(ans)
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())
ans = 1
temp = s[0]
for c in s:
    if c != temp:
        ans += 1
    temp = c
print(ans)

-for i in range(n - 1): -    if s[i] != s[i + 1]: +temp = s[0] +for c in s: +    if c != temp: +    temp = c