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

# You lost the game.

n = int(input())
s = str(input())

r = b = 0
m = 0
m2 = 0
for i in range(n):
    if s[i] == "r":
        r += 1
    else:
        b += 1

if n % 2:
    if r > b:
        for i in range(n):
            if s[i] == "b" and i % 2 == 0:
                m += 1
        for i in range(n):
            if s[i] == "b" and i % 2:
                m2 += 1
        print(min(m+(n-1)//2-b,m2+(n+1)//2-b))

    else:
        for i in range(n):
            if s[i] == "r" and i % 2 == 0:
                m += 1
        for i in range(n):
            if s[i] == "r" and i % 2:
                m2 += 1
        print(min(m+(n-1)//2-r,m2+(n+1)//2-r))

else:
    if r > b:
        for i in range(n):
            if s[i] == "b" and i % 2 == 0:
                m += 1
        for i in range(n):
            if s[i] == "b" and i % 2:
                m2 += 1
        print(min(m,m2)+n//2-b)
    else:
        for i in range(n):
            if s[i] == "r" and i % 2 == 0:
                m += 1
        for i in range(n):
            if s[i] == "r" and i % 2:
                m2 += 1
        print(min(m,m2)+n//2-r)  
