n=int(input())
c=input()
black=c.count("#")
white=c.count(".")

b=0
w=0
now=0
ans=float('inf')

for i in range(n):
  if c[i]=="#":
    b+=1
  elif c[i]==".":
    w+=1
  
  now=b+(white-w)
  ans=min(ans,now)
print(ans)