N = gets.to_i
S = gets.to_s
lb = 1000000000
rw = 1000000000
(1..N).each do |i|
  right = S[0, i]
  left = S[i, N-1]
  if lb + rw > right.count('#') + left.count('.')
    lb = right.count('#')
    rw = left.count('.')
  end
end
  p lb + rw