def solve():
  n = int(input())
  s = input()

  ans = 10**15
  a = s.count(".")
  b = s.count("#")
  for i in range(n+1):
   s1 = s[0:i]
   s2 = s[i::]
   tp = s1.count('#')
   tp2 = s2.count(".")
   ans = min(ans,tp+tp2)
  print(ans)
solve()