_=gets.to_i
s=gets.chomp
if s.index('#.').nil?
  puts 0
  exit 0
end

ia = []
d = 0
loop do
  i = s.index('.#', d)
  break if i.nil?
  ia << i
  d = i+1
end

map = ia.map do |m|
  ps = s[0..m]
  rs = s[m+1..-1]
  ps.count('#') + rs.count('.')
end
puts (map << s.count('.') << s.count('#')).min
