N = gets.to_i
S = gets.chomp

first_b = -1
number_of_whites = 0
number_of_black = 0
S.chars.each_with_index do |s, i|
  if s == '#'
    if first_b < 0
      first_b = i
    end
    number_of_black += 1
    next
  end

  if s == '.' && first_b >= 0
    number_of_whites += 1
  end
end

p [number_of_whites, number_of_black].min
