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 = list(input())
r1 = 0
r2 = 0
b1 = 0
b2 = 0

for i in range(n):
    if (i+1)%2 == 1:
        if s[i] == 'r':
            r1 += 1
        else:
            b1 += 1
    else:
        if s[i] == 'r':
            r2 += 1
        else:
            b2 += 1

swap = []
if r1 > r2 and r1 > b1 and r1 > b2:
    for i in range(0, n, 2):
        if s[i] == 'b':
            if i > 0:
                if s[i-1] == 'r' and i-1 not in swap:
                    swap.append(i-1)
                elif i < n-1:
                    if s[i+1] == 'r' and i+1 not in swap:
                        swap.append(i+1)
    print(r2+b1-len(swap))

elif r2 > r1 and r2 > b1 and r2 > b2:
    for i in range(1, n, 2):
        if s[i] == 'b':
            if i > 0:
                if s[i-1] == 'r' and i-1 not in swap:
                    swap.append(i-1)
                elif i < n-1:
                    if s[i+1] == 'r' and i+1 not in swap:
                        swap.append(i+1)
    print(r1+b2-len(swap))

elif b1 > r1 and b1 > r2 and b1 > b2:
    for i in range(0, n, 2):
        if s[i] == 'r':
            if i > 0:
                if s[i-1] == 'b' and i-1 not in swap:
                    swap.append(i-1)
                elif i < n-1:
                    if s[i+1] == 'b' and i+1 not in swap:
                        swap.append(i+1)
    print(b2+r1-len(swap))
else:
    for i in range(1, n, 2):
        if s[i] == 'r':
            if i > 0:
                if s[i-1] == 'b' and i-1 not in swap:
                    swap.append(i-1)
                elif i < n-1:
                    if s[i+1] == 'b' and i+1 not in swap:
                        swap.append(i+1)
    print(r2+b1-len(swap))