n = int(input())
s = input()
sr = s[::-1]

if s == "." * n or s == "#" * n:
    print(0)
else:
    ans = n
    for i in range(n):
        num = s[:i].count("#") + s[i:].count(".")
        ans = min(num, ans)
    print(ans)