n=int(input())
s=list(str(input()))

cont=0
best=n
for i in range(len(s)):
	for j in range(len(s)):
		if j<i and s[j]=='#':
			cont+=1
		if j>i and s[j]=='.':
			cont+=1
	if cont<best:
		best=cont
	if cont==0:
		break
	cont=0
print(best)