N = int(input())
S = list(input())
 
res1 = 0
for i in range(len(S)-1):
    if S[i] == '#' and S[i+1] == '.':
        if i+2 <= len(S)-1:
            if S[i+2] == '.':
                if i > 0:
                    if S[i-1] != '#':
                        S[i] = '.'
                        res1 += 1
                        continue
                else:
                    S[i] = '.'
                    res1 += 1
                    continue

        res1 += 1
        S[i+1] = '#'

res2 = 0
b,w = 0,0
for i in S:
    if i == '.':
        w += 1
    else:
        b += 1
res2 = min(b,w)

print(min(res1,res2))