import java.util.Collections

import scala.io.StdIn

object Main {
  def main(args: Array[String]) = {
    val N = StdIn.readInt
    val S = StdIn.readLine.toCharArray
    var dp = Array.fill[Int](N + 1, 2)(Int.MaxValue / 2)
    dp(0)(0) = 0
    dp(0)(1) = 0
    for(i <-1 until N) {
      if (S(i) == '.') {
        dp(i)(0) = Math.min(dp(i)(0), dp(i-1)(0))
        dp(i)(0) = Math.min(dp(i)(0), dp(i-1)(1) + 1)
      } else {
        dp(i)(1) = Math.min(dp(i)(1), dp(i-1)(1))
        dp(i)(1) = Math.min(dp(i)(1), dp(i-1)(0) + 1)
      }
    }
    val ans = Math.min(dp(N-1)(0), dp(N-1)(1))
    println(ans)
  }
}
