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

import sys
def read():
    return sys.stdin.readline().strip()
def printf(a, sep = ' ', end = '\n'):
    sys.stdout.write(sep.join(map(str, a)) + end)
    #printf([n])
def readf():
    return [int(i) for i in read().split()]
def dist(s, t, n):
    k = 0
    r = 0
    b = 0
    for i in range(n):
        if(s[i] != t[i]):
            if(s[i] == "b"):
                b += 1
            else:
                r += 1
            k += 1
    q = min(b, r)
    k -= q*2
    return q + k
def main():
    n = int(read())
    t = [str(i) for i in read()]
    a = ["r" if i%2 == 0 else "b" for i in range(n)]
    b = ["r" if i%2 == 1 else "b" for i in range(n)]
    printf([min(dist(a, t, n), dist(b, t, n))])
main()
