n=int(input())
s=list(input())
arg=0
for i in range(n):
    if s[i]=="#":
        arg=i
        break
ans=s[arg:].count(".")
ans_1=s.count("#")
k=0
for i in range(n):
    if s[-1-i]!="#":
        break
ans_1-=i
print(ans if ans < ans_1 else ans_1)