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
paint_req = 0

inp_list = list(s)


#print start_r 

chunks = ["".join(inp_list[i:i+2]) for i in range(0, len(inp_list), 2)]
count_rb = chunks.count('rb')
count_br = chunks.count('br')

if count_rb == 0 and count_br == 0:
	start_r = (chunks[0] == 'rr')
else:
	if count_rb == count_br:
		start_r = (chunks[-1]=='r')
	else:
		start_r = count_rb>count_br


if start_r:
	#swaps_needed = len(chunks) - chunks.count('rb')
	swaps_needed = count_br

else:
	swaps_needed = count_rb
	

count_bb = chunks.count('bb')  
count_rr = chunks.count('rr')

if count_bb>count_rr:
	swaps_needed += count_rr
	paint_req += count_bb - count_rr
else:
	swaps_needed += count_bb
	paint_req += count_rr - count_bb

if start_r and paint_req == 0 and chunks[-1] == 'b':
	#print "here"
	paint_req += 1
if not start_r and paint_req == 0 and chunks[-1] == 'r':
	#print "here"
	paint_req += 1




print paint_req+swaps_needed
#print chunks
#print start_r



 