import sys

n = int(input())
s = list(input())

if n == 1:
    print(1)
    sys.exit()

a = []

for i in range(n-1):
    if s[i] != s[i+1]:
        a.append(s[i])

if len(a) == 0:
    print(1)
else:
    if a[-1] != s[-1]:
        a.append(s[-1])

    print(len(a)) import sys sys n = int(input()) n int(input()) int input() input s = list(input()) s list(input()) list input() input if n == 1:
    print(1)
    sys.exit() n == 1 n 1 print(1) print 1 sys.exit() sys.exit sys exit a = [] a [] for i in range(n-1):
    if s[i] != s[i+1]:
        a.append(s[i]) i range(n-1) range n-1 n 1 if s[i] != s[i+1]:
        a.append(s[i]) s[i] != s[i+1] s[i] s i s[i+1] s i+1 i 1 a.append(s[i]) a.append a append s[i] s i if len(a) == 0:
    print(1)
else:
    if a[-1] != s[-1]:
        a.append(s[-1])

    print(len(a)) len(a) == 0 len(a) len a 0 print(1) print 1 if a[-1] != s[-1]:
        a.append(s[-1])

     a[-1] != s[-1] a[-1] a -1 s[-1] s -1 a.append(s[-1]) a.append a append s[-1] s -1 print(len(a)) print len(a) len a a = [] [] a s = list(input()) list(input()) s n = int(input()) int(input()) n
import sys

n = int(input())
s = list(input())

if n == 1:
    print(1)
    sys.exit()

a = []

for i in range(n-1):
    if s[i] != s[i+1]:
        a.append(s[i])

if len(a) == 0:
    print(1)
else:
    if a[-1] != s[-1]:
        a.append(s[-1])

    print(len(a))
