
n = gets.chomp.to_i
n += 1

s = gets.chomp

boundaries = []
curr = ""

min = 99999



s.chars.each_with_index do |a,i|

  if(a != curr)
    
    if a == "#"

      front = s.slice(0, i)
      back = s.slice(i, s.length)
    
      p1 = front.count("#")
      p2 = back.count(".")
      sum = p1 + p2

      min = sum if(min > sum)


    end
  
    curr = a

  end

end


min = 0 if (min == 99999)

puts min
 