n = gets.chomp.to_i
s = gets.chomp
countb = 0
countw = 0
abs = 0

(n - 1).downto(0) do |pos|
  if s[pos] == '.' then
    countw += 1
  else
    countb += 1
  end

  if countw < countb then
    abs += countw
    countb = 0
    countw = 0
  end
end

puts abs + [countw, countb].min
