n=int(eval(input()))

s=eval(input())

s=list(s)



for i in reversed(list(range(1,n))):

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

        s.pop(i)



print((len(s)))
import sys



n=int(eval(input()))

a=eval(input())

a=list(a)

a.reverse()

if n==1:

    print('1')

    sys.exit()

    

c=1





for i in range(n-1):

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

        c+=1



if c==0:

    c+=1

    

print(c)
n = int(eval(input()))
s = eval(input())
s = list(s)
for i in reversed(list(range(1, n))):
    if s[i - 1] == s[i]:
        s.pop(i)
print((len(s)))

import sys

n = int(eval(input()))
a = eval(input())
a = list(a)
a.reverse()
if n == 1:
    print("1")
    sys.exit()
c = 1
for i in range(n - 1):
    if a[i] != a[i + 1]:
        c += 1
if c == 0:
    c += 1
print(c)

+import sys + -s = eval(input()) -s = list(s) -for i in reversed(list(range(1, n))): -    if s[i - 1] == s[i]: -        s.pop(i) -print((len(s))) +a = eval(input()) +a = list(a) +a.reverse() +if n == 1: +    print("1") +    sys.exit() +c = 1 +for i in range(n - 1): +    if a[i] != a[i + 1]: +        c += 1 +if c == 0: +    c += 1 +print(c)