N = gets.to_i

Q = gets.to_s
arry = Q.split('')

count_black = 0
count_white = 0

i = 0

while i < N-1 do
	if arry[i] == "#"  &&  arry[i+1] =="."
		count_black += 1
		arry[i+1] = "#"
	end
	i += 1
end

while 0 < N - i - 1 do
	if arry[N-i-2] == "#"  &&  arry[N-1-i] =="."
		count_white += 1
		arry[N-i-2] = "."
	end
	i += 1
end

cum =[count_black, count_white]

puts cum.min