fun main(args: Array<String>) {
    val n = Integer.parseInt(readInputLine())
    var s = readInputLine()

    var res = 0
    
    var blackCount = 0
    for (c in s.toCharArray().toList()) {
        if (c == '#') {
            blackCount++
        } else {
            res += blackCount
            blackCount = 0
        }
    }
    
    // 全部白か黒に置き換えもカウント
    val allBlack = s.toCharArray().toList().count({ it == '.' })
    if (allBlack < res) {
        res = allBlack
    }
    
    val allWhite = s.toCharArray().toList().count({ it == '#' })
    if (allWhite < res) {
        res = allWhite
    }
    
    println(res)
}

fun readInputLine(): String {
    return readLine()!!
}
