n=gets.to_i
s=gets.chomp.split("")
if s.count("#").zero? or s.count(".").zero?
  puts 0
else
  min=10**9
  for i in 1..n-1
    whitesliced=s.slice(i,n-i)
    blacksliced=s.slice(0,i)
    white=whitesliced.count(".")
    black=blacksliced.count("#")
    min=white+black if min>white+black 
  end
  puts min
end
