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

counts_l = []
counts_r = []

count = 0
N.times{|i|
	counts_l[i] = count
	if S[i] == '#'
		count += 1
	end
}
counts_l << count

count = 0
N.times{|j|
	i = N - 1 - j
	counts_r[i + 1] = count
	if S[i] == '.'
		count += 1
	end
}
counts_r[0] = count

#p counts_l
#p counts_r

counts = []
(N + 1).times{|i|
	counts << counts_l[i] + counts_r[i]
}

#p counts
puts counts.min
