n = gets.chomp.to_i
s = gets.chomp

$r = n
(n-1).downto(0) do |i|
  if s[i] == "."
    $r = i
    break
  end
end

$l = 0
0.upto(n) do |i|
  if s[i] == "#"
    $l = i
    break
  end
end

puts [s[$l..$r].count("#"), s[$l..$r].count(".")].min
