import scala.io.{StdIn => in}

object Main extends App {
  val n = in.readInt
  val s = in.readLine.toArray

  val table = (0 until n).scanLeft(0)((acc, i) => {
    if(s(i) == '#') acc + 1 else acc
  })

  val ans = (0 to n)./:(Int.MaxValue)( (res, i) => {
    val w = table(i) - table(0)
    val b = (n-i) - (table(n) - table(i))
    res min (w + b)
  })
  println(ans)
}