length = int(eval(input()))

li = list(eval(input()))

i = 0

for n in li[:]:

    if i + 1 == len(li):

        print((len(li)))

        break

    if li[i] == li[i + 1]:

       del (li[i + 1])

    else:

        i = 1 + i

        continue
length = int(eval(input()))

li = list(eval(input()))

li2 = []

i = -1

for str in li[:]:

    i = 1 + i

    if i + 1 == len(li):

        li2.append(li[i])

        print((len(li2)))

        break

    if li[i] != li[i + 1]:

        li2.append(li[i])

        continue
length = int(eval(input()))
li = list(eval(input()))
i = 0
for n in li[:]:
    if i + 1 == len(li):
        print((len(li)))
        break
    if li[i] == li[i + 1]:
        del li[i + 1]
    else:
        i = 1 + i
        continue

length = int(eval(input()))
li = list(eval(input()))
li2 = []
i = -1
for str in li[:]:
    i = 1 + i
    if i + 1 == len(li):
        li2.append(li[i])
        print((len(li2)))
        break
    if li[i] != li[i + 1]:
        li2.append(li[i])
        continue

-i = 0 -for n in li[:]: +li2 = [] +i = -1 +for str in li[:]: +    i = 1 + i -        print((len(li))) +        li2.append(li[i]) +        print((len(li2))) -    if li[i] == li[i + 1]: -        del li[i + 1] -    else: -        i = 1 + i +    if li[i] != li[i + 1]: +        li2.append(li[i])