N = gets.to_i
S = gets.chomp.to_s
min = 2 * (10 ** 5)

(0..N).each do |i|
  black = S.slice(0, i).count("#")
  white = S.slice(i..N).count(".")

  min = black + white if (black + white) < min
end

puts min