N = int(eval(input()))

S = eval(input())

answer = [S[0]]

for i in range(1, N):

    if S[i] != S[i-1]:

        answer.append(S[i])

print((len(answer)))        
import sys



sr = lambda: sys.stdin.readline().rstrip()

ir = lambda: int(sr())

lr = lambda: list(map(int, sr().split()))



N = ir()

S = sr()

answer = 1

for x, y in zip(S, S[1:]):

    if x != y:

        answer += 1

print(answer)

N = int(eval(input()))
S = eval(input())
answer = [S[0]]
for i in range(1, N):
    if S[i] != S[i - 1]:
        answer.append(S[i])
print((len(answer)))

import sys

sr = lambda: sys.stdin.readline().rstrip()
ir = lambda: int(sr())
lr = lambda: list(map(int, sr().split()))
N = ir()
S = sr()
answer = 1
for x, y in zip(S, S[1:]):
    if x != y:
        answer += 1
print(answer)

-N = int(eval(input())) -S = eval(input()) -answer = [S[0]] -for i in range(1, N): -    if S[i] != S[i - 1]: -        answer.append(S[i]) -print((len(answer))) +import sys + +sr = lambda: sys.stdin.readline().rstrip() +ir = lambda: int(sr()) +lr = lambda: list(map(int, sr().split())) +N = ir() +S = sr() +answer = 1 +for x, y in zip(S, S[1:]): +    if x != y: +        answer += 1 +print(answer)