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

#http://codeforces.com/problemset/problem/719/B
#solved

n = int(input())
s = input()

black = 0
red = 0
wrong_black = False
wrong_red = False
red_black = True

for c in s:
    if red_black is True and c != "b":
        if wrong_black is False:
            black += 1
            wrong_black = True

        else:
            wrong_black = False

    elif red_black is False and c != "r":
        if wrong_black is False:
            black += 1
            wrong_black = True

        else:
            wrong_black = False

    else:
        wrong_black = False
    
    if red_black is True and c != "r":
        if wrong_red is False:
            red += 1
            wrong_red = True

        else:
            wrong_red = False

    elif red_black is False and c != "b":
        if wrong_red is False:
            red += 1
            wrong_red = True

        else:
            wrong_red = False

    else:
        wrong_red = False

    red_black = True if red_black is False else False

    
        

print(int(min(black, red)))