import sys
lines = [s.rstrip("\n") for s in sys.stdin.readlines()]
n = int(lines.pop(0))
s = lines.pop(0)
count = 0
prev_c = None
for c in s:
    if c != prev_c:
        count += 1
    prev_c = c
print(count) import sys sys s.rstrip("\n") for s in sys.stdin.readlines() for s in sys.stdin.readlines() s sys.stdin.readlines() sys.stdin.readlines sys.stdin sys stdin readlines for s in sys.stdin.readlines() s.rstrip("\n") s.rstrip s rstrip "\n" lines = [s.rstrip("\n") for s in sys.stdin.readlines()] lines [s.rstrip("\n") for s in sys.stdin.readlines()] n = int(lines.pop(0)) n int(lines.pop(0)) int lines.pop(0) lines.pop lines pop 0 s = lines.pop(0) s lines.pop(0) lines.pop lines pop 0 count = 0 count 0 prev_c = None prev_c None for c in s:
    if c != prev_c:
        count += 1
    prev_c = c c s if c != prev_c:
        count += 1
     c != prev_c c prev_c count += 1 count 1 prev_c = c prev_c c print(count) print count s = lines.pop(0) lines.pop(0) s count += 1 1 count prev_c = None None prev_c n = int(lines.pop(0)) int(lines.pop(0)) n lines = [s.rstrip("\n") for s in sys.stdin.readlines()] [s.rstrip("\n") for s in sys.stdin.readlines()] lines count = 0 0 count prev_c = c c prev_c
import sys
lines = [s.rstrip("\n") for s in sys.stdin.readlines()]
n = int(lines.pop(0))
s = lines.pop(0)
count = 0
prev_c = None
for c in s:
    if c != prev_c:
        count += 1
    prev_c = c
print(count)
