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

if '#' not in S:
    ans = 0
else:
    ans = 2*10**5
    for i in range(N):
        if S[i] == '#':
            ans = min(S[:i].count('#') + S[i:].count('.'), ans)

print(ans)