
n = int(input())
s = input()

ans = n
if s.count('#') == n or s.count('.') == n:
    ans = 0
    print(ans)
else:
    if num < ans:
        ans = num
    for i in range(n):
        num = s[:i].count('#') + s[i:].count('.')
        if num < ans:
            ans = num
    print(ans)