n = int(input())
s = input()
s = list(s)
l = 0
r = len(s)
for i in range(len(s)):
        if s[i] == "#":
                l = i
                break
for i in range(len(s))[::-1]:
        if s[i] == ".":
                r = i
                break
ss = s[l:r+1]
ans = 10**6
for i in range(len(ss)):
        ans = min(ans,ss[:i+1].count("#")+ss[i+1:].count("."))
print(ans)