n=int(input())
a=list(input())
b=100000
tmp=100000

for i in range(1,n):
  if (a[i]=="#" and a[i-1]=="."):
  	tmp=a[:i].count("#")+a[i:].count(".")
  if tmp<b:
    b=tmp
      
print(min(b,a.count("."),a.count("#")))