N = int(input())
S = str(input())
S = S.replace('.','0').replace('#','1')

i = 0
y = 0
for x in range(N):
    if i^int(S[x]) == 1:
        y += 1

j = 1
n = 0
for m in range(N):
    if j^int(S[m]) == 1:
        n += 1

print(min(y, n))