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

n = int(input())
s = input() + ' '

swap = False
c = 0
status = ''

for i, k in enumerate(s):
    if k == ' ': break
    if i == 0:
        status = k
        continue

    if swap is True:
        swap = False
        continue

    if status == 'r' and k == 'b':
        status = 'b'
        continue
    elif status == 'b' and k == 'r':
        status = 'r'
        continue
    elif status == 'r' and k == 'r':
        if s[i+1] == 'b':
            status = 'r'
            swap = True
            c += 1
            continue
        else:
            status = 'b'
            c += 1
            continue
    elif status == 'b' and k == 'b':
        if s[i+1] == 'r':
            status = 'b'
            swap = True
            c += 1
            continue
        else:
            status = 'r'
            c += 1
            continue

print(c)