import java.util.Collections

import scala.io.StdIn

object Main {
  def main(args: Array[String]) = {
    val N = StdIn.readInt
    val S = StdIn.readLine
    var whites = S.count(c => c == '.')
    var blacks = S.count(c => c == '#')

    var bcnt = 0
    for(i <- 0 until N) {
      if (whites > 0 && S.charAt(i) == '#') {
          bcnt += 1
      }
      if (S.charAt(i) == '.') {
        whites -= 1
      }
    }

    var wcnt = 0
    for(i <- N-1 to 0 by - 1) {
      if (blacks > 0  && S.charAt(i) == '.') {
          wcnt += 1
      }
      if (S.charAt(i) == '#') {
        blacks -= 1
      }
    }

    println(Math.min(bcnt, wcnt))
  }
}
