n=int(eval(input()))

s=eval(input())

if n==1:

    print((1))

else:

    slist=[]

    for i in range(len(s)):

        slist.append(s[i])

    

    for i in range(len(s)-1,0,-1):

        if slist[i-1]==slist[i]:

            del slist[i]



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

s=eval(input())



icnt=1

for i in range(len(s)-1):

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

        icnt+=1

print(icnt)
n = int(eval(input()))
s = eval(input())
if n == 1:
    print((1))
else:
    slist = []
    for i in range(len(s)):
        slist.append(s[i])
    for i in range(len(s) - 1, 0, -1):
        if slist[i - 1] == slist[i]:
            del slist[i]
    print((len(slist)))

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

-if n == 1: -    print((1)) -else: -    slist = [] -    for i in range(len(s)): -        slist.append(s[i]) -    for i in range(len(s) - 1, 0, -1): -        if slist[i - 1] == slist[i]: -            del slist[i] -    print((len(slist))) +icnt = 1 +for i in range(len(s) - 1): +    if s[i] != s[i + 1]: +        icnt += 1 +print(icnt)