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

white = s.gsub(/^\.+/, '').gsub(/#+$/, '').count('.')

black = s.gsub(/^\.+/, '').gsub(/#+$/, '').count('#')

if white <= black
    puts white
else
    puts black
end
