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

def sortFlips(working, check):
    flips =0
    if check == False:
        working[0] = not working[0]
        flips =1

    currentCheck =  not working[0]

    i =1
    while i < len(working) -1: 
        if working[i] == currentCheck:
            currentCheck = not currentCheck
            i +=1 
            continue
        if working[i+1] == currentCheck:
            working[i] = currentCheck
            working[i+1] = not currentCheck
            i+=2
            flips+=1
            continue
        working[i] = currentCheck
        currentCheck= not currentCheck
        i += 2
        flips+=1
    

    if working[-1] == working[-2]:
        flips +=1 


    return flips
n = input()
workingR = []
rbs = input()
n =0
while n < len(rbs):
    if rbs[n] == "r":
        workingR.append(True)
    else:
        workingR.append(False)
    n +=1 

workingB = workingR
changesR = sortFlips(workingR, True)
changesB = sortFlips(workingB, False)
if changesR > changesB:
    print(changesB)
else:
        print(changesR)
 	  			 	 	  			  	    	 		 	 	