n = int(input())
s = input()
cou = 0
if "#" not in s or "." not in s :
  print(0)
else:
  a = s.index("#")
  s_r = s[::-1]
  a1 = s_r.index(".")
  a3 = n-a1
  s1 = s[a:a3]
  b = s1.count(".")
  c = s1.count("#")
#  print(a,a3,b,c)
  print(min(b,c))