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(sys.stdin.readline())
line = [i == 'b' for i in list(sys.stdin.readline().strip())]
# so True == 'b'
# and False == 'r'
first = True
right = 0
for i in range(len(line)):
    if i % 2 == 0:
        if line[i] == True:
            right += 1
    else:
        if line[i] == False:
            right += 1

if right != max(right, len(line) - right):
    first = False

wrong_first = 0
wrong_second = 0

for i in range(len(line)):
    if i % 2 == 0:
        if line[i] != first:
            wrong_second += 1
    else:
        if line[i] == first:
            wrong_first += 1

swappable = min(wrong_first, wrong_second)
wrong = wrong_first + wrong_second

print wrong - swappable
