stone=int(input())
color=input()
result=100000
counter=0
left=''
right=''
if color.count('#') == 0 or color.count('.') == 0:
	result=0
else:
	for i in range(stone):
		left=color[:i]
		right=color[i:]
		w=left.count('#')
		b=right.count('.')
		if result > w+b:
			result=w+b
print(result)