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

c1=0
c2=0
f1=-1
f2=-1
for i in range(n):
  
  if f1==-1 and s[-i-1]==".":f1=1
  if f1==1 and s[-i-1]=="#":c1+=1 
 
  if f2==-1 and s[i]=="#":f2=1
  if f2==1 and s[i]==".":c2+=1

print(min(c1,c2))