a=input()
b=input()
scount=0
ccount=0
pp=0
ll=list()
for i in b:
        ll.append(i)
if "#" in ll:
        x=ll.index("#")
        y=ll.count(".")
        z=y-x
        q=ll.count("#")
        ccount=z
        
        for i in range(int(a)):
                scount-=1
                if ll[scount] == ".":
                        break
                else:
                        pp+=1
        if q-pp<z:
                ccount=q-pp

                
        
print(ccount)

