fun main(args: Array<String>) {
	val n = (readLine() ?: return).toInt()
	val s = (readLine() ?: return).toCharArray()
	var count1 = 0
	for (i in 0 until s.size - 1) if (s[i] == '#' && s[i + 1] == '.') {
		count1++
	}
	var count2 = 0
	for (i in 0 until s.size - 1) if (s[i] == '#' && s[i + 1] == '.') {
		count2++
		s[i + 1] = '#'
	}
	if (count1 < count2) println(count1)
	else println(count2)
}