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

n = int(raw_input())

set1 = 0
set2 = 0

if n%2 == 0:
	set1 = set2 = n/2
else:
	set1 = n/2
	set2 = set1 + 1

s = raw_input()

cnt1 = s.count('b')
cnt2 = s.count('r')

paint_req = min(abs(set1 - cnt1) , abs(set2 - cnt1) )

swap_needed = 0

inp_list = list(s)

start_r = (inp_list[0]=='r') 

chunks = ["".join(inp_list[i:i+2]) for i in range(0, len(inp_list), 2)]

if start_r:
	swaps_needed = len(chunks) - chunks.count('rb')
	if n%2 !=0:
		if inp_list[-1] == 'r':
			swaps_needed -= 1
else:
	swaps_needed = len(chunks) - chunks.count('br')
	if n%2 !=0:
		if inp_list[-1] == 'b':
			swaps_needed -= 1
if cnt1 == 0 or cnt2 == 0:
	swaps_needed = 0

print paint_req+swaps_needed



 