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 wCnt = 0
    var bCnt = 0
    var ans = Int.MaxValue
    for(i <- 0 until N) {
      if (S.charAt(i) == '.') {
        wCnt += 1
      }
      if (S.charAt(i) == '#') {
        bCnt += 1
      }
      ans = Math.min(ans, (whites - wCnt) + bCnt)
    }
    println(ans)

  }
}
