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