def solve():
  N = int(input())
  S = input()
  foundBlack = False
  black = S.count('#')
  white = N - black
  black -= N - S.rfind('.') - 1
  white -= S.find('#')
  return min(black, white)

print(solve())