from functools import reduce

_ = eval(input())

S = eval(input())

print((len(reduce(lambda a, b: a if a[-1] == b else a + b , S[1:], S[0]))))
from itertools import groupby

_ = eval(input())

print((len(tuple(groupby(eval(input()))))))

from functools import reduce

_ = eval(input())
S = eval(input())
print((len(reduce(lambda a, b: a if a[-1] == b else a + b, S[1:], S[0]))))

from itertools import groupby

_ = eval(input())
print((len(tuple(groupby(eval(input()))))))

-from functools import reduce +from itertools import groupby -S = eval(input()) -print((len(reduce(lambda a, b: a if a[-1] == b else a + b, S[1:], S[0])))) +print((len(tuple(groupby(eval(input()))))))