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(raw_input())
cockroaches = list(raw_input())

counter = {}
for c in cockroaches:
    counter[c] = counter.get(c, 0) + 1

curr = cockroaches[0]
counter[cockroaches[0]] -= 1
count = 0
for i in xrange(1, n):
    if curr == 'r':
        if cockroaches[i] == 'r':
            if counter.get('r', 0) > 0:
                for j in xrange(i + 1, n):
                    if cockroaches[j] == 'b':
                        cockroaches[i], cockroaches[j] = cockroaches[j], cockroaches[i]
                        break
            else:
                cockroaches[i] = 'b'
            count += 1
    else:
        if cockroaches[i] == 'b':
            if counter.get('r', 0) > 0:
                for j in xrange(i + 1, n):
                    if cockroaches[j] == 'r':
                        cockroaches[i], cockroaches[j] = cockroaches[j], cockroaches[i]
                        break
            else:
                cockroaches[i] = 'r'
            count += 1
    curr = cockroaches[i]
    counter[curr] = max(0, counter.get(curr, 0) - 1)

print(count)
