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

a = []
(0...n).each do |i|
  a << i if s[i] == '#'
end
if a.empty?
  puts 0
else 
m = []
a.each do |x|
  r = '.'*x + '#'*(n-x)
 m << (0...n).inject(0) {|cnt, i| cnt += 1 if r[i] != s[i]; cnt}
end
puts m.min
end