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

black_index = s.index('#')

if black_index == nil
  puts 0
  exit
end

black_count = s[black_index...n].count('.')

white_index = s.rindex('.')

if white_index == nil
  puts 0
  exit
end

white_count = s[0...white_index].count('#')

if black_count <= white_count
  puts black_count
else
  puts white_count
end
