n = int(eval(input()))

s= list(eval(input()))

ans = []

tmp = s[0]



if len(set(s)) == 1:

    print((1))

    exit()



for i in range(1, n):

    if s[i] == tmp:

        continue

    else:

        ans.append(tmp)

        tmp = s[i]



if ans[-1] == s[-1]:

    print((len(ans)))

else:

    ans.append(s[-1])

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

s = eval(input())

ans = 1



for i in range(n-1):

  ans += (s[i] != s[i+1])

  

print(ans)
n = int(eval(input()))
s = list(eval(input()))
ans = []
tmp = s[0]
if len(set(s)) == 1:
    print((1))
    exit()
for i in range(1, n):
    if s[i] == tmp:
        continue
    else:
        ans.append(tmp)
        tmp = s[i]
if ans[-1] == s[-1]:
    print((len(ans)))
else:
    ans.append(s[-1])
    print((len(ans)))

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

-s = list(eval(input())) -ans = [] -tmp = s[0] -if len(set(s)) == 1: -    print((1)) -    exit() -for i in range(1, n): -    if s[i] == tmp: -        continue -    else: -        ans.append(tmp) -        tmp = s[i] -if ans[-1] == s[-1]: -    print((len(ans))) -else: -    ans.append(s[-1]) -    print((len(ans))) +s = eval(input()) +ans = 1 +for i in range(n - 1): +    ans += s[i] != s[i + 1] +print(ans)