stone=input()
color=input()
a=int(stone)
result=100000
counter=0
left=''
right=''
black = 0
white = 0
xxx=[]
yyy=[]
list=[]
list2=[]
for i in range(a):
	left=color[:i]
	right=color[i:]
	w=left.count('#')
	b=right.count('.')
	if result > w+b:
		result=w+b
print(result)