n = gets.to_i
s = gets.strip
chunked = s.scan(/^\.*([^.].*[^#])#*$/)[0]

if chunked.nil?
  puts 0
else
  chunked = chunked[0].chars.chunk(&:itself).to_a
  ret = chunked.size.times.map do |i|
    head, tail = chunked[0..i], chunked[i+1..-1]
    count = head.map{|c, x| c == "#" ? x.size : 0 } + tail.map{|c, x| c == "." ? x.size : 0 }
    count.inject(&:+)
  end.min
 puts ret
end