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())

s = raw_input()

st = []
for i in s:
    if (i == 'r'):
        st += [0]
    else:
        st += [1]
#print st
d = {}
i = 1
val = st[0]
val = int(not val)

#print val
while (i < n):
    if (st[i] != val):
        d.update({i:st[i]})
    val = int(not val)
#    print val
    i += 1

#print d
count_one = 0
count_zero = 0

for k in d:
    if (d[k] == 1):
        count_one += 1
    else:
        count_zero += 1

#print count_one
#print count_zero
if (count_one == 0 or count_zero == 0):
    if (count_one):
        print count_one
    else:
        print count_zero
    exit(0)

if (count_one != count_zero):
    print min(count_one,count_zero) + abs(count_one - count_zero)
else:
    print count_one