import java.math.*

fun main(args: Array<String>) {
    readInputLine()
    val s = readInputLine().toCharArray()
    
    var rwNum = s.count { it == '.' }
    var rbNum = s.count { it == '#' }
    
    var lwNum = 0
    var lbNum = 0
    
    var ans = Int.MAX_VALUE
    
    ans = Math.min(ans, lbNum + rwNum)
    
    for (c in s) {
        if (c == '.') {
            lwNum++
            rwNum--
        } else {
            lbNum++
            rbNum--
        }
        
        ans = Math.min(ans, lbNum + rwNum)
    }

    println(ans)
}

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