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
n = int(input())
if n == 1:
    print(0)
    sys.exit(0)
s = list(input())
s2 = [i for i in s]
c = 0
r = []
b = []
if s[1] == 'r':
    for i in range(n):
        if i%2 == 1 and s[i] != 'r':
            b.append(i)
        if i%2 == 0 and s[i] != 'b':
            r.append(i)
else:
    for i in range(n):
        if i%2 == 0 and s[i] != 'r':
            b.append(i)
        if i%2 == 1 and s[i] != 'b':
            r.append(i)    
before = s[1]
#print('b =', b, 'r =', r)
c = 0
for i in range(n):
    if s[i] == before:
        if before == 'r':
            if len(b):
                s[b[0]] = 'r'
                b.pop(0)
            s[i] = 'b'
            if i in r:
                r.remove(i)
        else:
            if len(r):
                s[r[0]] = 'b'
                r.pop(0)
            s[i] = 'r'
            if i in b:
                b.remove(i)
        c+= 1
    before = s[i]
    #print(s)
#print(c)
r2 = []
b2 = []

#########################################################################
if s2[0] == 'r':
    for i in range(n):
        if i%2 == 0 and s2[i] != 'r':
            b2.append(i)
        if i%2 == 1 and s2[i] != 'b':
            r2.append(i)
else:
    for i in range(n):
        if i%2 == 1 and s2[i] != 'r':
            b2.append(i)
        if i%2 == 0 and s2[i] != 'b':
            r2.append(i)    
before = s2[0]
#print('b2 =', b2, 'r2 =', r2)
c2 = 0
for i in range(1, n):
    if s2[i] == before:
        if before == 'r':
            if len(b2):
                s2[b2[0]] = 'r'
                b2.pop(0)
            s2[i] = 'b'
            if i in r2:
                r2.remove(i)
        else:
            if len(r2):
                s2[r2[0]] = 'b'
                r2.pop(0)
            s2[i] = 'r'
            if i in b2:
                b2.remove(i)
        c2+= 1
    before = s2[i]
    #print(s2)
print(min(c2, c))