N = int(eval(input()))

S = eval(input())



res = 0

i = 0

while i < N:

    j = 1

    while i + j < N and S[i] == S[i + j]:

        j += 1

    i += j

    res += 1

print(res)
N = int(eval(input()))

S = eval(input())



res = 1

a = S[0]

for i in range(N):

    if a != S[i]:

        res += 1

        a = S[i]

print(res)
N = int(eval(input()))
S = eval(input())
res = 0
i = 0
while i < N:
    j = 1
    while i + j < N and S[i] == S[i + j]:
        j += 1
    i += j
    res += 1
print(res)

N = int(eval(input()))
S = eval(input())
res = 1
a = S[0]
for i in range(N):
    if a != S[i]:
        res += 1
        a = S[i]
print(res)

-res = 0 -i = 0 -while i < N: -    j = 1 -    while i + j < N and S[i] == S[i + j]: -        j += 1 -    i += j -    res += 1 +res = 1 +a = S[0] +for i in range(N): +    if a != S[i]: +        res += 1 +        a = S[i]