n = int(eval(input()))

s = eval(input())



current = 0

peek = 0

ans = s[peek]

for i in range(n):

    if s[current] != s[peek]:

        ans += s[peek]

        current = peek



    peek += 1



print((len(ans)))

n = int(eval(input()))

s = eval(input())



current = 0

ans = s[current]

for i in range(n):

    if s[current] != s[i]:

        ans += s[i]

        current = i



print((len(ans)))

n = int(eval(input()))
s = eval(input())
current = 0
peek = 0
ans = s[peek]
for i in range(n):
    if s[current] != s[peek]:
        ans += s[peek]
        current = peek
    peek += 1
print((len(ans)))

n = int(eval(input()))
s = eval(input())
current = 0
ans = s[current]
for i in range(n):
    if s[current] != s[i]:
        ans += s[i]
        current = i
print((len(ans)))

-peek = 0 -ans = s[peek] +ans = s[current] -    if s[current] != s[peek]: -        ans += s[peek] -        current = peek -    peek += 1 +    if s[current] != s[i]: +        ans += s[i] +        current = i