n=input()
n=int(n)

s=input()

ans = n

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

print(ans)