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

def verifica(lista):
    curr = lista[0]
    for i in range(1,len(lista)):
        if(curr == 'r' and not(lista[i] == 'b')):
            return False
        elif(curr == 'b' and not(lista[i] == 'r')):
            return False
        else:
            curr = lista[i]
    return True

n = int(input())

crock = list(input())
if(verifica(crock)):
    print(0)
else:
    #0 == r, 1 == b
    turn = 0
    if(crock[0] == 'b'):
        turn = 1

    qtdRed = float("inf")
    qtdBlack = float("inf")
    for c in crock:
        if(c == 'r' and turn == 1):
            if(qtdRed == float("inf")):
                qtdRed = 1
            else:
                qtdRed+=1
        elif(c == 'b' and turn == 0):
            if(qtdBlack == float("inf")):
                qtdBlack=1
            else:
                qtdBlack+=1
        turn = (turn+1)%2
    print(min(qtdBlack,qtdRed))
