n=input()
n=int(n)

s=input()

ans = n

for i in range(n):
	tmp_w=""
	tmp_b=""
	tmp_t=""
	tmp_ans=0
	for k in range(i):
		tmp_b += "#"
	for m in range(n-i):
		tmp_w += "."
	tmp_t = tmp_w + tmp_b
	#print(tmp_t)
	for loop in range(n):
		if s[loop] != tmp_t[loop]:
			tmp_ans +=1
	ans =min([ans,tmp_ans])

print(ans)