N=int(input())
S=input()
curb=S.find("#")
curw=S.rfind(".")
def solve():
	if curb==-1:
		return 0
	else:
		if curw==-1:
			return 0
		else:
			return min(S[:curw+1].count("#"),S[curb:].count("."))
print(solve())