import java.util.*

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

    val fb = s.indexOfFirst { it == '.' }
    if (fb < 0) return println(0)

    val a = s.drop(fb).map { if (it == '.') 1 else 0 }.sum()
    val ret = Math.min(a, s.length - fb - a)

    println(ret)
}