N=int(input())
S=input()

if "#" not in S or "." not in S:
	print("0")
	exit(0)

mostLeftBlack=S.index("#")
mostRightWhite=S.rindex(".")

tmpS=S[mostLeftBlack:]
targ="."
ansB=tmpS.count(targ)

tmpS=S[:mostRightWhite]
targ="#"
ansW=tmpS.count(targ)

ans = min(ansB,ansW)


print(ans)