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

judge = false
ans_a = 0
s.each do |ss|
  if ss == '#'
    judge = true
  end
  if judge && ss == '.'
    ans_a += 1
  end
end

judge = false
ans_b = 0
(n-1).downto(0) do |i|
  ss = s[i]
  if ss == "."
    judge = true
  end
  if judge && ss == '#'
    ans_b += 1
  end
end

puts [ans_a, ans_b].min
