N=int(input())
S=input()
count_W=0
count_B=0
W=0
B=0
tmp=0
for i in range(N):
	if B==1 and S[i]==".":
		count_B+=1
	if B==0 and S[i]=="#":
		B=1
for i in range(N):
	if W==0 and S[-(i+1)]==".":
		W=1
	if W==1 and S[-(i+1)]=="#":
		count_W+=1
print(min(count_B,count_W))