object Main {

  def main(args: Array[String]): Unit = {

    def find(l: List[Char]): Int = {
      def min(a: Int, b: Int): Int =
        if (a > b) b else a
      @annotation.tailrec
      def go(l: List[Char], lBlack: Int, rWhite: Int, minN: Int): Int =
        l match {
          case Nil => minN
          case '#' :: t => go(t, lBlack + 1, rWhite,     min(minN, lBlack + rWhite + 1))
          case '.' :: t => go(t, lBlack,     rWhite - 1, min(minN, lBlack + rWhite - 1))
        }
      go(l, 0, l.count(_ == '.'), l.size)
    }

    scala.io.StdIn.readLine()
    println(find(scala.io.StdIn.readLine().toList))
  }

}