n=int(eval(input()))

s=eval(input())

ans=1

for i in range(1,n):

    if s[i]!=s[i-1]:

        ans+=1

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

s=eval(input())

ans=1

b_c=s[0]

for i in s[1:]:

  if b_c!=i:

    ans+=1

  b_c=i

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

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

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