N = int(input())
S = input()
ary = [0]
t = '.'
for s in S:
    if s == t:
        ary[-1] += 1
    else:
        ary.append(1)
        t = s
w = 0
b = 0
for n in ary[::2]:
    w += n
for n in ary[1:-1:2]:
    b += n
if len(ary) % 2:
    b += ary[-1]
print(min(w, b))
