n = gets.to_i
s = gets.strip
chunked = s.scan(/^\.*([^.].*[^#])#*$/)[0][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 || 0
