N=int(input())
S=input()
count=0
count_2=0
tmp=0
for i in range(N):
	if S[i]=="#":
		count+=1

for i in range(N):
	if tmp==1:
		if S[i]==".":
			count_2+=1
	elif S[i]=="#":
		tmp=1

print(min(count,count_2))