N = gets.to_i
S = gets.strip.split(//)

counts = []
if first = S.index('#')
	count = 0
	((first + 1)...N).each{|i|
		count += 1 if S[i] == '.'
	}
	counts << count
else
	counts << 0
end

if last = S.rindex('.')
	count = 0
	(0...last).each{|i|
		count += 1 if S[i] == '#'
	}
	counts << count
else
	counts << 0
end

#p counts
puts counts.min
