n = int(eval(input()))

s = input().rstrip()





def rle(s):

    import itertools

    return list([(x[0], len(list(x[1]))) for x in itertools.groupby(s)])





print((len(rle(s))))
import itertools

import sys



input = sys.stdin.readline



ri = lambda: int(eval(input()))

rs = lambda: input().rstrip()

ril = lambda: list(map(int, input().split()))

rsl = lambda: input().rstrip().split()

ris = lambda n: [ri() for _ in range(n)]

rss = lambda n: [rs() for _ in range(n)]

rils = lambda n: [ril() for _ in range(n)]

rsls = lambda n: [rsl() for _ in range(n)]



n = ri()

s = rs()

print((len(list(itertools.groupby(s)))))
n = int(eval(input()))
s = input().rstrip()


def rle(s):
    import itertools

    return list([(x[0], len(list(x[1]))) for x in itertools.groupby(s)])


print((len(rle(s))))

import itertools
import sys

input = sys.stdin.readline
ri = lambda: int(eval(input()))
rs = lambda: input().rstrip()
ril = lambda: list(map(int, input().split()))
rsl = lambda: input().rstrip().split()
ris = lambda n: [ri() for _ in range(n)]
rss = lambda n: [rs() for _ in range(n)]
rils = lambda n: [ril() for _ in range(n)]
rsls = lambda n: [rsl() for _ in range(n)]
n = ri()
s = rs()
print((len(list(itertools.groupby(s)))))

-n = int(eval(input())) -s = input().rstrip() +import itertools +import sys - -def rle(s): -    import itertools - -    return list([(x[0], len(list(x[1]))) for x in itertools.groupby(s)]) - - -print((len(rle(s)))) +input = sys.stdin.readline +ri = lambda: int(eval(input())) +rs = lambda: input().rstrip() +ril = lambda: list(map(int, input().split())) +rsl = lambda: input().rstrip().split() +ris = lambda n: [ri() for _ in range(n)] +rss = lambda n: [rs() for _ in range(n)] +rils = lambda n: [ril() for _ in range(n)] +rsls = lambda n: [rsl() for _ in range(n)] +n = ri() +s = rs() +print((len(list(itertools.groupby(s)))))