n = gets.chomp.to_i
s = gets.chomp.to_s
x = []
if s.index("#.") == nil
  puts 0
  exit
else
  x << s[0..s.rindex("#.")].scan("#").length
  x << s[s.index("#.") + 1..s.length].scan(".").length
  puts x.min
end
