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

if "." not in s or "#" not in s:
    print(0)
else:
    ans = len(s)
    s = s[s.find("#"):n-s[::-1].find(".")]
    for i in range(len(s)):
        ans = min(ans, s[:i+1].count("#") + s[i+1:].count("."))
    print(ans)
