import kotlin.math.min

fun main(args: Array<String>) {
    val n = readLine()!!.toInt()
    val s = readLine()!!
    var leftBlackCount = 0
    var rightWhiteCount = s.count { it == '.' }
    var ans = rightWhiteCount
    s.forEach {
        if (it == '#') {
            leftBlackCount++
        } else {
            rightWhiteCount--
        }
        ans = min(ans, rightWhiteCount + leftBlackCount)
    }
    println(ans)
}