def solve():
  n = int(input())
  s = input()
  ans = 0
  a = s.count(".")
  b = s.count("#")
  count = 0
  if a == n:
    print("0")
  else:
    for i in range(n):
      if s[i] =="#":
        print(a-count)
        exit()
      else:
        count += 1
        
solve()