N=int(eval(input()))

S=list(eval(input()))

check=[]

for i in range(N-1):

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

    check.append(i)

check=reversed(check)

for i in check:

  S.pop(i)

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

S=list(eval(input()))

check=0

for i in range(N-1):

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

    check+=1



print((len(S)-check))
N = int(eval(input()))
S = list(eval(input()))
check = []
for i in range(N - 1):
    if S[i] == S[i + 1]:
        check.append(i)
check = reversed(check)
for i in check:
    S.pop(i)
print((len(S)))

N = int(eval(input()))
S = list(eval(input()))
check = 0
for i in range(N - 1):
    if S[i] == S[i + 1]:
        check += 1
print((len(S) - check))

-check = [] +check = 0 -        check.append(i) -check = reversed(check) -for i in check: -    S.pop(i) -print((len(S))) +        check += 1 +print((len(S) - check))