def solve():
  N = int(input())
  S = input()
  foundBlack = False
  black, b, white = 0, 0, 0

  for stone in S:
    if stone == '#':
      if not foundBlack: foundBlack = True
      b = b + 1
    else:
      if not foundBlack: continue
      white = white + 1
      black = black + b
      b = 0
  return min(black, white)

print(solve())
