n = gets.chomp.to_i
s = gets.chomp

black_count = s.count('#')
white_count = s.count('.')
if black_count == 0 || white_count == 0
  puts 0
  exit
end

search_char = black_count <= white_count ? '#' : '.'
index = 0
min_count = n
while true do
  border_index = s.index('#', index)
  break if border_index == nil
  index = border_index + 1

  count = s[0...border_index].count('#') + s[border_index...n].count('.')
  if count < min_count
    min_count = count
  end
end
puts min_count
