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

am = int(input())
arr = list(input())
for i in range(am):
    if arr[i] == "r":
        arr[i] = 1
    else:
        arr[i] = 0
ans = 0
# print(arr)
# First case: 01010101
onesWrong = 0
nullsWrong = 0
for i in range(am):
    if arr[i]!=i%2:
        if arr[i]:
            onesWrong+=1
        else:
            nullsWrong+=1
# print(onesWrong)
# print(nullsWrong)
ans = min(onesWrong,nullsWrong) + (max(onesWrong,nullsWrong) - min(onesWrong,nullsWrong))
# print('----')
# Second case: 10101010
onesWrong = 0
nullsWrong = 0
for i in range(am):
    if arr[i] != (i%2 + 1) % 2:
        if arr[i]:
            onesWrong+=1
        else:
            nullsWrong+=1
# print(onesWrong)
# print(nullsWrong)
ans = min(min(onesWrong,nullsWrong) + (max(onesWrong,nullsWrong) - min(onesWrong,nullsWrong)),ans)
print(ans)
