166
rbbbbbbbbbbbbrbrrbbrbbbrbbbbbbbbbbrbbbbbbrbbbrbbbbbrbbbbbbbrbbbbbbbrbbrbbbbbbbbrbbbbbbbbbbbbbbrrbbbrbbbbbbbbbbbbbbrbrbbbbbbbbbbbrbbbbbbbbbbbbbbrbbbbbbbbbbbbbbbbbbbbbb
 7
rrbrbrb
 1
r
 2
bb
 18
rrrrrrrrrrrrrrrrrb
 8
rbbrbrbr
 1
b
 13
rbbbrbrrbrrbb
 100
brbbbrrrbbrbrbbrbbrbbbbrbbrrbbbrrbbbbrbrbbbbbbbbbbbbbbbbrrrrbbbbrrrbbbbbbbrbrrbrbbbbrrrbbbbrbbrbbbrb
 2
rb
 2
rr
 2
br

70
 1
 0
 1
 8
 1
 0
 3
 34
 0
 1
 0

number_of_cockroaches = int(input())
colors_of_cockroaches = list(raw_input())
counter = 0

if number_of_cockroaches > 1:
    for number in range(0, number_of_cockroaches - 2):
        if colors_of_cockroaches[number] is colors_of_cockroaches[number + 1]:
            if (number + 2 <= number_of_cockroaches - 1) and (colors_of_cockroaches[number + 1] is not colors_of_cockroaches[number + 2]):
                colors_of_cockroaches[number + 1], colors_of_cockroaches[number + 2] = colors_of_cockroaches[number + 2], colors_of_cockroaches[number + 1]
                counter += 1
            elif colors_of_cockroaches[number + 1] is 'r':
                colors_of_cockroaches[number + 1] = 'b'
                counter += 1
            else:
                colors_of_cockroaches[number + 1] = 'r'
                counter += 1

print(counter)
