fun main(args: Array<String>) {
    val n = readLine()!!.toInt()
    val s = readLine()!!.toString()
    val ss = s.toCharArray()
    println(Math.min(ss.count { it == '#' }, ss.count { it == '.' }))
}
