fun main(args: Array<String>) {
    tenka12019beginnerc()
}

fun tenka12019beginnerc() {
    val n = readLine()!!.toInt()
    val s = readLine()!!

    var left = 0
    var right: Int
    var answer = 0
    while (left <= s.lastIndex && s[left] == '.') left++
    while (left <= s.lastIndex) {
        while (left <= s.lastIndex && s[left] == '#') left++
        right = left
        while (right <= s.lastIndex && s[right] == '.') right++
        answer += right - left
        left = right
    }

    println(answer)
}
