import java.lang.Math

fun main(args: Array<String>) {
  val n = readLine()
  val s = readLine()!!
  var b = 0
  var w = s.count { c -> c == '.' }
  var ans = b + w
  for(c in s) {
    when(c) {
      '#' -> b++
      '.' -> w--
    }
    ans = Math.min(ans, b + w)
  }
  println(ans)
}