N=int(eval(input()))

S=eval(input())

mae=S[0]

now=""

ans=S[0]

for i in range(N):

  now=S[i]

  if now==mae:

    continue

  else:

    ans+=now

    mae=now



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

S=eval(input())

mae=S[0]

now=""

ans=0

for i in range(N-1):

  if S[i]!=S[i+1]:

    ans+=1

print((ans+1))

N = int(eval(input()))
S = eval(input())
mae = S[0]
now = ""
ans = S[0]
for i in range(N):
    now = S[i]
    if now == mae:
        continue
    else:
        ans += now
        mae = now
print((len(ans)))

N = int(eval(input()))
S = eval(input())
mae = S[0]
now = ""
ans = 0
for i in range(N - 1):
    if S[i] != S[i + 1]:
        ans += 1
print((ans + 1))

-ans = S[0] -for i in range(N): -    now = S[i] -    if now == mae: -        continue -    else: -        ans += now -        mae = now -print((len(ans))) +ans = 0 +for i in range(N - 1): +    if S[i] != S[i + 1]: +        ans += 1 +print((ans + 1))