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