n=int(eval(input()))

s=str(eval(input()))

ans=[]

ans.append(s[0])

cnt=0

for i in range(1,n):

  if ans[cnt]==s[i]:

    continue

  else:

    cnt+=1

    ans.append(s[i])

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

s=str(eval(input()))

cnt=1

for i in range(n-1):

  if s[i]==s[i+1]:

    continue

  else:

    cnt+=1

print(cnt)
n = int(eval(input()))
s = str(eval(input()))
ans = []
ans.append(s[0])
cnt = 0
for i in range(1, n):
    if ans[cnt] == s[i]:
        continue
    else:
        cnt += 1
        ans.append(s[i])
print((len(ans)))

n = int(eval(input()))
s = str(eval(input()))
cnt = 1
for i in range(n - 1):
    if s[i] == s[i + 1]:
        continue
    else:
        cnt += 1
print(cnt)

-ans = [] -ans.append(s[0]) -cnt = 0 -for i in range(1, n): -    if ans[cnt] == s[i]: +cnt = 1 +for i in range(n - 1): +    if s[i] == s[i + 1]: -        ans.append(s[i]) -print((len(ans))) +print(cnt)