import java.util.*
import java.math.*
fun main(args: Array<String>) {

    val N = readLine()!!.toInt()
    var ansb = 0
    var answ = 0
    var isBlack = false;
    var isWhite = false;
    var tmpb = 0
    for (c in readLine()!!) {
        if (c == '#') {
            tmpb++
            isBlack = true
        }
        if (c == '.') {
            if (isBlack) ansb++
            answ += tmpb
            tmpb = 0
        }
    }

    println(Math.min(ansb,answ));
}
