from itertools import groupby

n = int(eval(input()))

s = eval(input())



gr = groupby(s)

ans = 0

for key, value in gr:

    ans += 1



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

s = eval(input())



ans = 0

before = ""

for i in s:

    if i != before:

        ans += 1

        before = i



print(ans)
from itertools import groupby

n = int(eval(input()))
s = eval(input())
gr = groupby(s)
ans = 0
for key, value in gr:
    ans += 1
print(ans)

n = int(eval(input()))
s = eval(input())
ans = 0
before = ""
for i in s:
    if i != before:
        ans += 1
        before = i
print(ans)

-from itertools import groupby - -gr = groupby(s) -for key, value in gr: -    ans += 1 +before = "" +for i in s: +    if i != before: +        ans += 1 +        before = i