#import sys
#import numpy as np
import math
#from fractions import Fraction
import itertools
from collections import deque
from collections import Counter
import heapq
#from fractions  import gcd
#input=sys.stdin.readline
import bisect
n=int(input())
s=input()
ans=n
for i in range(1,n):
    if s[i]==s[i-1]:
        ans-=1
print(ans) import math math import itertools itertools from collections import deque from collections import Counter import heapq heapq import bisect bisect n=int(input()) n int(input()) int input() input s=input() s input() input ans=n ans n for i in range(1,n):
    if s[i]==s[i-1]:
        ans-=1 i range(1,n) range 1 n if s[i]==s[i-1]:
        ans-=1 s[i]==s[i-1] s[i] s i s[i-1] s i-1 i 1 ans-=1 ans 1 print(ans) print ans ans-=1 1 ans s=input() input() s n=int(input()) int(input()) n ans=n n ans
#import sys
#import numpy as np
import math
#from fractions import Fraction
import itertools
from collections import deque
from collections import Counter
import heapq
#from fractions  import gcd
#input=sys.stdin.readline
import bisect
n=int(input())
s=input()
ans=n
for i in range(1,n):
    if s[i]==s[i-1]:
        ans-=1
print(ans)