import java.util.*

fun main(args: Array<String>) {
    val sc = Scanner(System.`in`)
    val n = sc.nextInt()
    val s = sc.next()

    var count = 0
    val bc = s.map {
        if (it == '#') count++
        count
    }

    val c = bc.last()
    val ret = bc.foldIndexed(Integer.MAX_VALUE) { index, acc, next ->
        val cur = bc[index] + ((n - 1 - index) - (c - bc[index]))
        Math.min(acc, cur)
    }

    println(ret)
}
