
n = gets.chomp.to_i

s = gets.chomp

curr = ""

min = 99999



for i in 0..n-1 do
  
  a = s[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
 




