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

b=0
w=s.count(".")
ans = n
for i in range(n):
    if s[i]!=s[i-1] and i>0:
        ans=min(ans,b+w)
    if s[i]=="#":
        b=b+1
    if s[i]==".":
        w=w-1
    
print(min(ans,b+w))