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())


def other(c):
    return 'b' if c == 'r' else 'r'


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):
    c = other(curr)
    if cockroaches[i] != c:
        if counter.get(c, 0) > 0:
            for j in xrange(i + 1, n):
                if cockroaches[j] == c:
                    cockroaches[i], cockroaches[j] = cockroaches[j], cockroaches[i]
                    break
        else:
            cockroaches[i] = c
        count += 1
    counter[c] = max(0, counter.get(c, 0) - 1)
    curr = cockroaches[i]

print(count)
