n=int(input())
s=input()
a=[]
for i in s:
  a.append(i)
if ("#" in a )and("." in a):
  k=a.index("#")
  ans1=a[k+1:len(a)].count(".")
  a.reverse()
  k=a.index(".")
  ans2=a[k+1:len(a)].count("#")
  print(min(ans1,ans2))
else:
  print(0)