fun main(args: Array<String>) {
    val n = readLine()!!.toInt()
    val s = readLine()!!.toCharArray()

    var ans = 0

    for (i in (0 until (n - 1))) {
        if (s[i] == '#' && s[i + 1] == '.') {
            s[i + 1] = '#'
            ans++
        }
    }

    println(ans)
}