input()
S = input()

if '#' in S:
    black = S.index('#')
    ans = [S[black:].count('#'), S[black:].count('.')]
    if ans[0] <= ans[1]:
        for c in S[::-1]:
            if c == '#':
                ans[0] -= 1
            else:
                break
        print(ans[0])
    else:
        print(ans[1])
else:
    print(0)
