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]
ans1 = ss.count(".")
ans2 = ss.count("#")
print(min(ans1,ans2))