import java.lang.Math.min

fun Boolean.toInt() = if (this) 1 else 0

fun main(args: Array<String>) {
    val n = readLine()!!.toInt()
    val s = readLine()!!
    val bCumSum = mutableListOf(0)
    val wCumSum = mutableListOf(0)
    for (i in 0 until n) {
        bCumSum.add(bCumSum[i] + (s[i] == '#').toInt())
        wCumSum.add(wCumSum[i] + (s[i] == '.').toInt())
    }
    var ans = n
    for (i in 0..n) {
        val wDiff = bCumSum[i] - bCumSum[0]
        val bDiff = wCumSum[n] - wCumSum[i]
        ans = min(ans, wDiff + bDiff)
    }
    println(ans)
}