N = int(input())
S = list(input())

if S.count('.') >= S.count('#'):
    u = 'w'
else:
    u = 'b'

res = 0
for i in range(len(S)-1):
    if S[i] == '#' and S[i+1] == '.':
        if u == 'w':
            res += 1
            S[i] = '.'
        else:
            res += 1
            S[i+1] == '#' 

print(res)