# coding: utf-8
# Your code here!
n=int(input())
l=list(input())
m=0
b_ans=n
for i in range(len(l)-1):
    if (l[i]=="#" and l[i+1]=="."):
        lm=[]
        lm2=[]
        m=i+1
        lm=l[m:]
        lm2=l[:m]
        b=lm.count(".")+lm2.count("#")
        b_ans=min(b,b_ans)
        #print(lm)

a=l.count("#")
c=l.count(".")
ans=min(a,b,c)
print(ans)
#print(lm)