n = gets.to_i
s = gets.chomp
loop do
  if s[0] == "."
    s[0] = ""
  else
    break
  end
end
loop do
  if s[-1] == "#"
    s[-1] = ""
  else
    break
  end
end
black = 0
white = 0
s.each_char do |c|
  if c == "#"
    black += 1
  else
    white += 1
  end
end
p [black,white].min