fun main(args: Array<String>) {
	val n = (readLine() ?: return).toInt()
	val s = (readLine() ?: return).toCharArray()
	var white = 0
	for (i in 0 until s.size) if (s[i] == '.') white++
	var min = if (white > s.size) s.size - white else white
	var black = 0
	for (i in 0 until s.size - 1) {
		if (s[i] == '#') black++
		else if (s[i] == '.') {
			white--
			min = Math.min(min, black + white)
		}
	}
	print(min)
}