fun main(args: Array<String>) {
    val n = readLine()!!.toInt()
    val s = readLine()!!

    var b = 0
    var w = s.filter { it == '.' }.count()

    var ans = w

    for (i in (0 until n)) {
        if (s[i] == '#') {
            b++
        } else {
            w--
        }
        ans = Math.min(ans, b + w)
    }

    println(ans)
}